Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bill Lorensen
VTK
Commits
3e5c98c1
Commit
3e5c98c1
authored
May 04, 2012
by
Utkarsh Ayachit
⛰
Committed by
Kitware Robot
May 04, 2012
Browse files
Merge topic '12898_fix_text_bounding_box' into pv-master
24da3fc7
BUG #12898. Fixed occasional clipping of text.
parents
73185627
24da3fc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Rendering/vtkTextActor.cxx
View file @
3e5c98c1
...
...
@@ -592,13 +592,22 @@ void vtkTextActor::ComputeRectangle(vtkViewport *viewport)
dims
[
0
]
=
(
text_bbox
[
1
]
-
text_bbox
[
0
]
+
1
);
dims
[
1
]
=
(
text_bbox
[
3
]
-
text_bbox
[
2
]
+
1
);
// compuet TCoords
// compute TCoords.
// GetBoundingBox(..) returns the box that will contains rendered text.
// BUG #13133: We ensure that x-min offset is also taken into consideration.
vtkFloatArray
*
tc
=
vtkFloatArray
::
SafeDownCast
(
this
->
Rectangle
->
GetPointData
()
->
GetTCoords
()
);
tc
->
InsertComponent
(
1
,
1
,
static_cast
<
double
>
(
dims
[
1
]
)
/
p2dims
[
1
]
);
tc
->
InsertComponent
(
2
,
0
,
static_cast
<
double
>
(
dims
[
0
]
)
/
p2dims
[
0
]
);
tc
->
InsertComponent
(
2
,
1
,
static_cast
<
double
>
(
dims
[
1
]
)
/
p2dims
[
1
]
);
tc
->
InsertComponent
(
3
,
0
,
static_cast
<
double
>
(
dims
[
0
]
)
/
p2dims
[
0
]
);
tc
->
InsertComponent
(
0
,
0
,
static_cast
<
double
>
(
text_bbox
[
0
])
/
p2dims
[
0
]);
tc
->
InsertComponent
(
0
,
1
,
0.0
);
tc
->
InsertComponent
(
1
,
0
,
static_cast
<
double
>
(
text_bbox
[
0
])
/
p2dims
[
0
]);
tc
->
InsertComponent
(
1
,
1
,
static_cast
<
double
>
(
dims
[
1
])
/
p2dims
[
1
]);
tc
->
InsertComponent
(
2
,
0
,
static_cast
<
double
>
(
text_bbox
[
0
]
+
dims
[
0
])
/
p2dims
[
0
]);
tc
->
InsertComponent
(
2
,
1
,
static_cast
<
double
>
(
dims
[
1
])
/
p2dims
[
1
]);
tc
->
InsertComponent
(
3
,
0
,
static_cast
<
double
>
(
text_bbox
[
0
]
+
dims
[
0
])
/
p2dims
[
0
]);
tc
->
InsertComponent
(
3
,
1
,
0.0
);
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment