From 450f2b2dfe0bc61266c0a772fcc878cdf158ef35 Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Fri, 8 Jun 2012 20:07:41 +0100 Subject: 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. --- tikzit/src/gtk/GraphRenderer.m | 10 ++++++++-- 1 file 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; -- cgit v1.2.3