summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabiertxof <jabier.arraiza@marker.es>2018-11-14 18:41:15 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-12-01 16:17:15 +0000
commit4affc03b7f081f92e9e5e56026d747d5b81ed247 (patch)
treee8bf08a12835cf7b751924b7bf1603ec8720d221 /src
parentAllow drag controller on split (diff)
downloadinkscape-4affc03b7f081f92e9e5e56026d747d5b81ed247.tar.gz
inkscape-4affc03b7f081f92e9e5e56026d747d5b81ed247.zip
Fixes to contoler position and auto hide
Diffstat (limited to 'src')
-rw-r--r--src/display/sp-canvas.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index e6823a86c..862bca995 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -1710,8 +1710,10 @@ int SPCanvas::handle_motion(GtkWidget *widget, GdkEventMotion *event)
GtkAllocation allocation;
canvas->_splitdragging = true;
gtk_widget_get_allocation(GTK_WIDGET(canvas), &allocation);
+ double hide_horiz = 1/(allocation.width/(double)cursor_pos[Geom::X]);
+ double hide_vert = 1/(allocation.height/(double)cursor_pos[Geom::Y]);
double value = vertical ? 1/(allocation.width/(double)cursor_pos[Geom::X]) : 1/(allocation.height/(double)cursor_pos[Geom::Y]);
- if (value < 0.03 || value > 0.97) {
+ if (hide_horiz < 0.03 || hide_horiz > 0.97 || hide_vert < 0.03 || hide_vert > 0.97) {
SPDesktop * desktop = SP_ACTIVE_DESKTOP;
if (desktop && desktop->event_context) {
desktop->event_context->sp_event_context_update_cursor();
@@ -1879,7 +1881,8 @@ void SPCanvas::paintSpliter()
if(canvas->_splitercontolpos != Geom::Point()) {
middle[Geom::X] = vertical ? middle[Geom::X] : canvas->_splitercontolpos[Geom::X];
middle[Geom::Y] = vertical ? canvas->_splitercontolpos[Geom::Y] : middle[Geom::Y];
- }
+ }
+ canvas->_splitercontolpos = middle;
canvas->_spliter_control = Geom::OptIntRect(Geom::IntPoint(int(middle[0] - (25 * ds)), int(middle[1] - (25 * ds))), Geom::IntPoint(int(middle[0] + (25 * ds)), int(middle[1] + (25 * ds))));
canvas->_spliter_top = Geom::OptIntRect(Geom::IntPoint(int(middle[0] - (25 * ds)), int(middle[1] - (25 * ds))), Geom::IntPoint(int(middle[0] + (25 * ds)), int(middle[1] - (10 * ds))));
canvas->_spliter_bottom = Geom::OptIntRect(Geom::IntPoint(int(middle[0] - (25 * ds)), int(middle[1] + (25 * ds))), Geom::IntPoint(int(middle[0] + (25 * ds)), int(middle[1] + (10 * ds))));