diff options
author | Alex Merry <dev@randomguy3.me.uk> | 2013-09-01 12:05:17 +0100 |
---|---|---|
committer | Alex Merry <dev@randomguy3.me.uk> | 2013-09-01 12:05:17 +0100 |
commit | eb56a2ca0faf7a0e7b8da2f149a9d88783314d82 (patch) | |
tree | 7600f49be48c4b39196ddf32db2c5b03b1a53509 /tikzit | |
parent | 367a9dd91462b2f1b52292d3f9af3be8d325cddb (diff) |
GTK: Properly clear the renderer from the old tool
Fixes, for example, unsetting the cursor when changing from the bounding
box tool.
Diffstat (limited to 'tikzit')
-rw-r--r-- | tikzit/src/gtk/GraphEditorPanel.m | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tikzit/src/gtk/GraphEditorPanel.m b/tikzit/src/gtk/GraphEditorPanel.m index c1fdffd..dac52a0 100644 --- a/tikzit/src/gtk/GraphEditorPanel.m +++ b/tikzit/src/gtk/GraphEditorPanel.m @@ -96,13 +96,16 @@ static const InputMask zoomPanMask = ControlMask; [[[renderer document] pickSupport] deselectAllNodes]; [[[renderer document] pickSupport] deselectAllEdges]; - BOOL hadOldTool = ([tool activeRenderer] == renderer); - id oldTool = tool; + BOOL weHadTool = ([oldTool activeRenderer] == renderer); + if (weHadTool) { + [oldTool setActiveRenderer:nil]; + } + tool = [t retain]; [oldTool release]; - if (hadOldTool) { + if (weHadTool) { [self grabTool]; } } |