Commit 102a14ff authored by Guillaume Seguin's avatar Guillaume Seguin

Ensure canvas is marked as dirty when setting showall in gviz

parent ec76dc6d
...@@ -123,6 +123,17 @@ class window(wx.Frame): ...@@ -123,6 +123,17 @@ class window(wx.Frame):
elif z < 0: self.p.zoom(event.GetX(), event.GetY(), 1/1.2) elif z < 0: self.p.zoom(event.GetX(), event.GetY(), 1/1.2)
class gviz(wx.Panel): class gviz(wx.Panel):
# Mark canvas as dirty when setting showall
_showall = 0
def _get_showall(self):
return self._showall
def _set_showall(self, showall):
if showall != self._showall:
self.dirty = 1
self._showall = showall
showall = property(_get_showall, _set_showall)
def __init__(self, parent, size = (200, 200), build_dimensions = [200, 200, 100, 0, 0, 0], grid = (10, 50), extrusion_width = 0.5): def __init__(self, parent, size = (200, 200), build_dimensions = [200, 200, 100, 0, 0, 0], grid = (10, 50), extrusion_width = 0.5):
wx.Panel.__init__(self, parent, -1, size = size) wx.Panel.__init__(self, parent, -1, size = size)
self.SetMinSize((150, 150)) self.SetMinSize((150, 150))
...@@ -291,8 +302,8 @@ class gviz(wx.Panel): ...@@ -291,8 +302,8 @@ class gviz(wx.Panel):
def paint(self, event): def paint(self, event):
dc = wx.PaintDC(self) dc = wx.PaintDC(self)
if self.dirty: if self.dirty:
self.repaint()
self.dirty = 0 self.dirty = 0
self.repaint()
sz = self.GetClientSize() sz = self.GetClientSize()
dc.DrawBitmap(self.blitmap, 0, 0) dc.DrawBitmap(self.blitmap, 0, 0)
del dc del dc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment