Commit 27bd47f015335e95a4fd3a15f53a12a4c6d9b849

Authored by Thiago Franco de Moraes
1 parent d528e089
Exists in master

Brain segmentation was not working

Showing 1 changed file with 9 additions and 6 deletions   Show diff stats
invesalius/gui/widgets/gradient.py
@@ -26,12 +26,15 @@ from wx.lib import intctrl @@ -26,12 +26,15 @@ from wx.lib import intctrl
26 26
27 from invesalius.gui.widgets.inv_spinctrl import InvSpinCtrl 27 from invesalius.gui.widgets.inv_spinctrl import InvSpinCtrl
28 28
29 -dc = wx.MemoryDC()  
30 -font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)  
31 -dc.SetFont(font)  
32 -PUSH_WIDTH = dc.GetTextExtent("M")[0] // 2 + 1  
33 -del dc  
34 -del font 29 +try:
  30 + dc = wx.MemoryDC()
  31 + font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
  32 + dc.SetFont(font)
  33 + PUSH_WIDTH = dc.GetTextExtent("M")[0] // 2 + 1
  34 + del dc
  35 + del font
  36 +except Exception:
  37 + PUSH_WIDTH = 7
35 38
36 myEVT_SLIDER_CHANGED = wx.NewEventType() 39 myEVT_SLIDER_CHANGED = wx.NewEventType()
37 EVT_SLIDER_CHANGED = wx.PyEventBinder(myEVT_SLIDER_CHANGED, 1) 40 EVT_SLIDER_CHANGED = wx.PyEventBinder(myEVT_SLIDER_CHANGED, 1)