@@ -509,7 +509,7 @@ def set_cursor(self, cursor):
509
509
def draw_rubberband (self , event , x0 , y0 , x1 , y1 ):
510
510
# adapted from
511
511
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/189744
512
- self . ctx = self .canvas .get_property ("window" ).cairo_create ()
512
+ ctx = self .canvas .get_property ("window" ).cairo_create ()
513
513
514
514
# todo: instead of redrawing the entire figure, copy the part of
515
515
# the figure that was covered by the previous rubberband rectangle
@@ -522,11 +522,11 @@ def draw_rubberband(self, event, x0, y0, x1, y1):
522
522
h = abs (y1 - y0 )
523
523
rect = [int (val ) for val in (min (x0 , x1 ), min (y0 , y1 ), w , h )]
524
524
525
- self . ctx .new_path ()
526
- self . ctx .set_line_width (0.5 )
527
- self . ctx .rectangle (rect [0 ], rect [1 ], rect [2 ], rect [3 ])
528
- self . ctx .set_source_rgb (0 , 0 , 0 )
529
- self . ctx .stroke ()
525
+ ctx .new_path ()
526
+ ctx .set_line_width (0.5 )
527
+ ctx .rectangle (rect [0 ], rect [1 ], rect [2 ], rect [3 ])
528
+ ctx .set_source_rgb (0 , 0 , 0 )
529
+ ctx .stroke ()
530
530
531
531
def _update_buttons_checked (self ):
532
532
for name , active in [("Pan" , "PAN" ), ("Zoom" , "ZOOM" )]:
0 commit comments