Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused _needs_redraw from gtk3 backends.
  • Loading branch information
anntzer committed Jul 9, 2017
commit 05e5ae1074927aa8c4fae60289468de52c69a52e
5 changes: 0 additions & 5 deletions lib/matplotlib/backends/backend_gtk3.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def __init__(self, figure):
GObject.GObject.__init__(self)

self._idle_draw_id = 0
self._need_redraw = True
self._lastCursor = None

self.connect('scroll_event', self.scroll_event)
Expand Down Expand Up @@ -299,20 +298,16 @@ def configure_event(self, widget, event):
w, h = event.width, event.height
if w < 3 or h < 3:
return # empty fig

# resize the figure (in inches)
dpi = self.figure.dpi
self.figure.set_size_inches(w/dpi, h/dpi, forward=False)
self._need_redraw = True

return False # finish event propagation?

def on_draw_event(self, widget, ctx):
# to be overwritten by GTK3Agg or GTK3Cairo
pass

def draw(self):
self._need_redraw = True
if self.get_visible() and self.get_mapped():
self.queue_draw()
# do a synchronous draw (its less efficient than an async draw,
Expand Down
7 changes: 2 additions & 5 deletions lib/matplotlib/backends/backend_gtk3agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ def on_draw_event(self, widget, ctx):
w, h = allocation.width, allocation.height

if not len(self._bbox_queue):
if self._need_redraw:
self._render_figure(w, h)
bbox_queue = [transforms.Bbox([[0, 0], [w, h]])]
else:
return
self._render_figure(w, h)
bbox_queue = [transforms.Bbox([[0, 0], [w, h]])]
else:
bbox_queue = self._bbox_queue

Expand Down
5 changes: 0 additions & 5 deletions lib/matplotlib/backends/backend_gtk3cairo.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,10 @@ def _render_figure(self, width, height):
def on_draw_event(self, widget, ctx):
""" GtkDrawable draw event, like expose_event in GTK 2.X
"""
# the _need_redraw flag doesnt work. it sometimes prevents
# the rendering and leaving the canvas blank
#if self._need_redraw:
self._renderer.set_context(ctx)
allocation = self.get_allocation()
x, y, w, h = allocation.x, allocation.y, allocation.width, allocation.height
self._render_figure(w, h)
#self._need_redraw = False

return False # finish event propagation?


Expand Down