diff options
author | Alex Merry <dev@randomguy3.me.uk> | 2013-08-27 15:38:59 +0100 |
---|---|---|
committer | Alex Merry <dev@randomguy3.me.uk> | 2013-08-27 15:38:59 +0100 |
commit | 0f8c707a69c3bb6d11798866975aac4976e4c22b (patch) | |
tree | f8ed531d38cf096ad713f667f0d2c2cc13077b14 /tikzit/src/gtk | |
parent | ad6c6441f4482e12722ae17283dd7a470e3fdcde (diff) |
Properly clear selection box
It turns out the selection box, rather than being properly set to the
zero rectangle, was being set to the value of an uninitialised NSRect
created on the stack. This never caused any issues for me before,
because my system compiles things with _FORTIFY_SOURCE by default, which
zeros new variables. It was only when I (indirectly) disabled this for
debugging in gdb that I started getting selection boxes appearing in odd
places.
Diffstat (limited to 'tikzit/src/gtk')
-rw-r--r-- | tikzit/src/gtk/SelectTool.m | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tikzit/src/gtk/SelectTool.m b/tikzit/src/gtk/SelectTool.m index deae55a..2aa2104 100644 --- a/tikzit/src/gtk/SelectTool.m +++ b/tikzit/src/gtk/SelectTool.m @@ -560,8 +560,7 @@ static void drag_select_mode_cb (GtkToggleButton *button, SelectTool *tool); - (void) clearSelectionBox { NSRect oldRect = selectionBox; - NSRect emptyRect; - selectionBox = emptyRect; + selectionBox = NSZeroRect; [renderer invalidateRect:NSInsetRect (oldRect, -2, -2)]; [renderer clearHighlightedNodes]; |