Commit 0035de9b45ce6357c662043fd3d4d64c74962d4a

Authored by tfmoraes
1 parent 5199899e

STYLE: Some style changes in code

Showing 1 changed file with 9 additions and 7 deletions   Show diff stats
invesalius/gui/widgets/clut_raycasting.py
... ... @@ -42,6 +42,7 @@ RADIUS = 5
42 42 SELECTION_SIZE = 10
43 43 TOOLBAR_SIZE = 30
44 44 TOOLBAR_COLOUR = (25 , 25, 25)
  45 +RANGE = 10
45 46 PADDING = 2
46 47  
47 48 class Node(object):
... ... @@ -277,8 +278,8 @@ class CLUTRaycastingWidget(wx.Panel):
277 278 doesn't change values in preset, only to visualization.
278 279 """
279 280 direction = evt.GetWheelRotation() / evt.GetWheelDelta()
280   - init = self.init - 10 * direction
281   - end = self.end + 10 * direction
  281 + init = self.init - RANGE * direction
  282 + end = self.end + RANGE * direction
282 283 print direction, init, end
283 284 self.SetRange((init, end))
284 285 self.Refresh()
... ... @@ -434,14 +435,15 @@ class CLUTRaycastingWidget(wx.Panel):
434 435 node.x += (x - self.previous_wl)
435 436 node.graylevel = self.PixelToHounsfield(node.x)
436 437  
  438 + self.previous_wl = x
  439 + self.to_draw_points = True
  440 + self.Refresh()
  441 +
437 442 # The window level has been changed, raising a event!
438 443 evt = CLUTEvent(myEVT_CLUT_CURVE_WL_CHANGE, self.GetId(),
439 444 self.curve_dragged)
440 445 self.GetEventHandler().ProcessEvent(evt)
441 446  
442   - self.previous_wl = x
443   - self.Refresh()
444   -
445 447 def RemovePoint(self, i, j):
446 448 """
447 449 The point the point in the given i,j index
... ... @@ -530,8 +532,8 @@ class CLUTRaycastingWidget(wx.Panel):
530 532 font = ctx.CreateFont(font, TEXT_COLOUR)
531 533 ctx.SetFont(font)
532 534  
533   - text1 = "Value: %6d" % value
534   - text2 = "Alpha: %.3f" % alpha
  535 + text1 = _("Value: %-6d" % value)
  536 + text2 = _("Alpha: %-.3f" % alpha)
535 537  
536 538 if ctx.GetTextExtent(text1)[0] > ctx.GetTextExtent(text2)[0]:
537 539 wt, ht = ctx.GetTextExtent(text1)
... ...