mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-08 21:03:45 +08:00
Add on_scroll behavior and allow line to change width.
This commit is contained in:
@@ -75,6 +75,7 @@ class LineTool(CanvasToolBase):
|
||||
|
||||
self._line.set_data(np.transpose(pts))
|
||||
self._handles.set_data(np.transpose(pts))
|
||||
self._line.set_linewidth(self.linewidth)
|
||||
|
||||
self.set_visible(True)
|
||||
self.redraw()
|
||||
|
||||
@@ -83,6 +83,7 @@ class EventManager(object):
|
||||
self.connect_event('key_press_event', self.on_key_press)
|
||||
self.connect_event('button_release_event', self.on_mouse_release)
|
||||
self.connect_event('motion_notify_event', self.on_move)
|
||||
self.connect_event('scroll_event', self.on_scroll)
|
||||
|
||||
self.tools = []
|
||||
self.active_tool = None
|
||||
@@ -128,6 +129,11 @@ class EventManager(object):
|
||||
if not tool is None:
|
||||
tool.on_move(event)
|
||||
|
||||
def on_scroll(self, event):
|
||||
tool = self._get_tool(event)
|
||||
if not tool is None:
|
||||
tool.on_scroll(event)
|
||||
|
||||
|
||||
class ImageViewer(QtGui.QMainWindow):
|
||||
"""Viewer for displaying images.
|
||||
|
||||
Reference in New Issue
Block a user