summaryrefslogtreecommitdiffstats
path: root/src/display
diff options
context:
space:
mode:
authorJabiertxof <jabier.arraiza@marker.es>2019-08-02 16:37:57 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2019-08-02 21:26:28 +0000
commitf3ecf7a2de4a54b11603849501087aec13de9548 (patch)
treecbc201e9109d545eef13e41495c043b23e41266d /src/display
parentFix coding style (diff)
downloadinkscape-f3ecf7a2de4a54b11603849501087aec13de9548.tar.gz
inkscape-f3ecf7a2de4a54b11603849501087aec13de9548.zip
Allow tools sensitive when overflow canvas area also fix a bug i couldent remember about ruberband selection
Diffstat (limited to 'src/display')
-rw-r--r--src/display/sp-canvas.cpp9
-rw-r--r--src/display/sp-canvas.h5
2 files changed, 11 insertions, 3 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index cb42f2daf..71478eaeb 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -1012,6 +1012,7 @@ static void sp_canvas_init(SPCanvas *canvas)
canvas->_xray = false;
canvas->_xray_orig = Geom::Point();
canvas->_changecursor = 0;
+ canvas->_inside = false; // this could be wrong on start but we update it as far we bo to the other side.
bool _is_dragging;
#if defined(HAVE_LIBLCMS2)
@@ -1167,7 +1168,7 @@ void SPCanvas::handle_size_allocate(GtkWidget *widget, GtkAllocation *allocation
// Allocation does not depend on device scale.
GtkAllocation old_allocation;
gtk_widget_get_allocation(widget, &old_allocation);
-
+
// For HiDPI monitors.
canvas->_device_scale = gtk_widget_get_scale_factor( widget );
@@ -2318,7 +2319,11 @@ gint SPCanvas::handle_crossing(GtkWidget *widget, GdkEventCrossing *event)
if (event->window != getWindow(canvas)) {
return FALSE;
}
-
+ if (event->type == GDK_LEAVE_NOTIFY) {
+ canvas->_inside = false;
+ } else {
+ canvas->_inside = true;
+ }
canvas->_state = event->state;
return canvas->pickCurrentItem(reinterpret_cast<GdkEvent *>(event));
}
diff --git a/src/display/sp-canvas.h b/src/display/sp-canvas.h
index b4be65887..9242cce6e 100644
--- a/src/display/sp-canvas.h
+++ b/src/display/sp-canvas.h
@@ -99,7 +99,7 @@ struct SPCanvas {
private:
/// Emits an event for an item in the canvas, be it the current
/// item, grabbed item, or focused item, as appropriate.
- int emitEvent(GdkEvent *event);
+ int emitEvent(GdkEvent *event);
/// Re-picks the current item in the canvas, based on the event's
/// coordinates and emits enter/leave events for items as appropriate.
@@ -223,6 +223,9 @@ public:
/// Last known modifier state, for deferred repick when a button is down.
int _state;
+ /// Get idf we are outside canvas area
+ bool _inside;
+
/** The item containing the mouse pointer, or NULL if none. */
SPCanvasItem *_current_item;