Commit 3a7cf7f87520035e7a10548af524c1c469026fb5
1 parent
09be8cfc
Exists in
master
and in
68 other branches
FIX: using textactor in place of textmapper to zero work in Linux and Window
Showing
1 changed file
with
7 additions
and
13 deletions
Show diff stats
invesalius/data/viewer_slice.py
... | ... | @@ -214,18 +214,12 @@ class Viewer(wx.Panel): |
214 | 214 | text_property.SetFontFamilyToTimes() |
215 | 215 | text_property.BoldOn() |
216 | 216 | text_property.SetColor(colour) |
217 | - | |
218 | - # Text related to slice number shown | |
219 | - text_mapper = vtk.vtkTextMapper() | |
220 | - text_mapper.SetInput("%d"%(self.slice_number)) | |
221 | - text_mapper.GetTextProperty().ShallowCopy(text_property) | |
222 | - self.text_mapper = text_mapper | |
223 | - | |
224 | - text_actor = vtk.vtkActor2D() | |
225 | - text_actor.SetMapper(text_mapper) | |
226 | - text_actor.SetLayerNumber(1) | |
227 | - text_actor.GetPositionCoordinate().SetValue(2, 2) | |
228 | - text_actor.SetVisibility(1) | |
217 | + | |
218 | + text_actor = vtk.vtkTextActor() | |
219 | + text_actor.SetInput("%d" % self.slice_number) | |
220 | + text_actor.GetTextProperty().ShallowCopy(text_property) | |
221 | + text_actor.SetPosition(2,2) | |
222 | + self.text_actor = text_actor | |
229 | 223 | |
230 | 224 | ren.AddActor(actor) |
231 | 225 | ren.AddActor(text_actor) |
... | ... | @@ -284,7 +278,7 @@ class Viewer(wx.Panel): |
284 | 278 | evt.Skip() |
285 | 279 | |
286 | 280 | def SetSliceNumber(self, index): |
287 | - self.text_mapper.SetInput(str(index)) | |
281 | + self.text_actor.SetInput(str(index)) | |
288 | 282 | self.slice_number = index |
289 | 283 | self.__update_display_extent() |
290 | 284 | ... | ... |