~ubuntu-branches/ubuntu/utopic/python-chaco/utopic

« back to all changes in this revision

Viewing changes to enthought/chaco/tools/line_segment_tool.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-04-06 19:03:54 UTC
  • mfrom: (7.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110406190354-rwd55l2ezjecfo41
Tags: 3.4.0-2
d/rules: fix pyshared directory path (Closes: #621116)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
""" Defines the LineSegmentTool class.
2
2
"""
 
3
from __future__ import with_statement
 
4
 
3
5
# Major library imports
4
6
from numpy import array
5
7
 
305
307
        """
306
308
        draw_func = getattr(self, self.event_state + "_draw", None)
307
309
        if draw_func:
308
 
            gc.save_state()
309
 
            gc.clip_to_rect(component.x, component.y, component.width-1, component.height-1)
310
 
            draw_func(gc)
311
 
            gc.restore_state()
 
310
            with gc:
 
311
                gc.clip_to_rect(component.x, component.y, component.width-1, component.height-1)
 
312
                draw_func(gc)
312
313
        return
313
314
    
314
315
    def request_redraw(self):