Fix flickering in debug panel
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Tue, 31 Jul 2018 14:17:41 +0300
changeset 2257 eb6b68c4439f
parent 2256 5927710b5610
child 2258 c9915bc620cd
Fix flickering in debug panel

This flickering made debug panel unusable, because most of the time
panel was white. This problem effects wxPython with GTK3+ backend
(at least on GNU/Linux systems).

Removed code IIUC draws box with content of moved debug variable, I
don't see any effect of it neither on GNU/Linux nor on Windows. It
should be safe to remove.
controls/DebugVariablePanel/DebugVariablePanel.py
--- a/controls/DebugVariablePanel/DebugVariablePanel.py	Mon Jul 30 19:28:39 2018 +0300
+++ b/controls/DebugVariablePanel/DebugVariablePanel.py	Tue Jul 31 14:17:41 2018 +0300
@@ -35,8 +35,6 @@
 import matplotlib
 matplotlib.use('WX')   # noqa
 import matplotlib.pyplot
-from matplotlib.backends.backend_wxagg import _convert_agg_to_wx_bitmap
-
 
 from editors.DebugViewer import DebugViewer
 from util.BitmapLibrary import GetBitmap
@@ -525,24 +523,6 @@
     def RefreshView(self):
         self.RefreshCanvasPosition()
 
-        width, height = self.GraphicsWindow.GetVirtualSize()
-        bitmap = wx.EmptyBitmap(width, height)
-        dc = wx.BufferedDC(wx.ClientDC(self.GraphicsWindow), bitmap)
-        dc.Clear()
-        dc.BeginDrawing()
-        if self.DraggingAxesPanel is not None:
-            destBBox = self.DraggingAxesBoundingBox
-            srcBBox = self.DraggingAxesPanel.GetAxesBoundingBox()
-
-            srcBmp = _convert_agg_to_wx_bitmap(self.DraggingAxesPanel.get_renderer(), None)
-            srcDC = wx.MemoryDC()
-            srcDC.SelectObject(srcBmp)
-
-            dc.Blit(destBBox.x, destBBox.y,
-                    int(destBBox.width), int(destBBox.height),
-                    srcDC, srcBBox.x, srcBBox.y)
-        dc.EndDrawing()
-
         if not self.Fixed or self.Force:
             self.Force = False
             refresh_graphics = True