summaryrefslogtreecommitdiff
path: root/tikzit/src/gtk/GraphRenderer.m
diff options
context:
space:
mode:
authorAlex Merry <dev@randomguy3.me.uk>2012-06-08 20:07:41 +0100
committerAlex Merry <dev@randomguy3.me.uk>2012-06-08 20:07:41 +0100
commit450f2b2dfe0bc61266c0a772fcc878cdf158ef35 (patch)
tree52d2ee421ea7240dcd6ed8ff81603317d1e23c24 /tikzit/src/gtk/GraphRenderer.m
parentee3648293706ce512277532951fa015ecfc0ee3e (diff)
Make resize handles more consistent
Before, we allowed resizing when the mouse to be anywhere along the top or bottom edges of the bounding box, but on the left and right the cursor had to be over a handle. Now it always has to be over a handle.
Diffstat (limited to 'tikzit/src/gtk/GraphRenderer.m')
-rw-r--r--tikzit/src/gtk/GraphRenderer.m10
1 files changed, 8 insertions, 2 deletions
diff --git a/tikzit/src/gtk/GraphRenderer.m b/tikzit/src/gtk/GraphRenderer.m
index 571390f..22e227f 100644
--- a/tikzit/src/gtk/GraphRenderer.m
+++ b/tikzit/src/gtk/GraphRenderer.m
@@ -390,11 +390,17 @@ void graph_renderer_expose_event(GtkWidget *widget, GdkEventExpose *event);
}
} else if (p.y >= NSMaxY(bbox)) {
if (p.y <= NSMaxY(bbox) + size) {
- return SouthHandle;
+ float southHandleLeft = tbHandleLeft(bbox);
+ if (p.x >= southHandleLeft && p.x <= (southHandleLeft + size)) {
+ return SouthHandle;
+ }
}
} else if (p.y <= NSMinY(bbox)) {
if (p.y >= NSMinY(bbox) - size) {
- return NorthHandle;
+ float northHandleLeft = tbHandleLeft(bbox);
+ if (p.x >= northHandleLeft && p.x <= (northHandleLeft + size)) {
+ return NorthHandle;
+ }
}
}
return NoHandle;