Reduce flicker in svg demos

This commit is contained in:
Metallicow
2020-10-19 03:32:58 -05:00
parent 6dd5689daa
commit efec3bcca5
2 changed files with 3 additions and 1 deletions

View File

@@ -21,6 +21,8 @@ class SVGBitmapDisplay(wx.Panel):
sbox = wx.StaticBoxSizer(wx.VERTICAL, self, label)
sbox.Add(self.statbmp)
self.SetSizer(sbox)
if not self.IsDoubleBuffered():
self.SetDoubleBuffered(True) # Reduce flicker on size event.
def UpdateSVG(self, svg_filename):

View File

@@ -33,7 +33,7 @@ class SVGRenderPanel(wx.Panel):
def OnPaint(self, event):
dc = wx.PaintDC(self)
dc = wx.BufferedPaintDC(self)
dc.Clear()
iw, ih = (self._img.width, self._img.height) if self._img else (100,100)