33 |
33 |
34 # pylint: disable=wrong-import-position |
34 # pylint: disable=wrong-import-position |
35 import matplotlib |
35 import matplotlib |
36 matplotlib.use('WX') # noqa |
36 matplotlib.use('WX') # noqa |
37 import matplotlib.pyplot |
37 import matplotlib.pyplot |
38 from matplotlib.backends.backend_wxagg import _convert_agg_to_wx_bitmap |
|
39 |
|
40 |
38 |
41 from editors.DebugViewer import DebugViewer |
39 from editors.DebugViewer import DebugViewer |
42 from util.BitmapLibrary import GetBitmap |
40 from util.BitmapLibrary import GetBitmap |
43 |
41 |
44 from controls.DebugVariablePanel.DebugVariableItem import DebugVariableItem |
42 from controls.DebugVariablePanel.DebugVariableItem import DebugVariableItem |
523 self.RefreshGraphicsWindowScrollbars() |
521 self.RefreshGraphicsWindowScrollbars() |
524 |
522 |
525 def RefreshView(self): |
523 def RefreshView(self): |
526 self.RefreshCanvasPosition() |
524 self.RefreshCanvasPosition() |
527 |
525 |
528 width, height = self.GraphicsWindow.GetVirtualSize() |
|
529 bitmap = wx.EmptyBitmap(width, height) |
|
530 dc = wx.BufferedDC(wx.ClientDC(self.GraphicsWindow), bitmap) |
|
531 dc.Clear() |
|
532 dc.BeginDrawing() |
|
533 if self.DraggingAxesPanel is not None: |
|
534 destBBox = self.DraggingAxesBoundingBox |
|
535 srcBBox = self.DraggingAxesPanel.GetAxesBoundingBox() |
|
536 |
|
537 srcBmp = _convert_agg_to_wx_bitmap(self.DraggingAxesPanel.get_renderer(), None) |
|
538 srcDC = wx.MemoryDC() |
|
539 srcDC.SelectObject(srcBmp) |
|
540 |
|
541 dc.Blit(destBBox.x, destBBox.y, |
|
542 int(destBBox.width), int(destBBox.height), |
|
543 srcDC, srcBBox.x, srcBBox.y) |
|
544 dc.EndDrawing() |
|
545 |
|
546 if not self.Fixed or self.Force: |
526 if not self.Fixed or self.Force: |
547 self.Force = False |
527 self.Force = False |
548 refresh_graphics = True |
528 refresh_graphics = True |
549 else: |
529 else: |
550 refresh_graphics = False |
530 refresh_graphics = False |