summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2018-09-21 18:04:37 +0000
committerThomas Holder <thomas@thomas-holder.de>2018-09-21 18:15:55 +0000
commitec7a928bacad3df202e92b552f50af4dc9e275cb (patch)
tree8c373faa982d24321b65daa65a81b39dff47b7a1 /src
parentminor correction to MR (diff)
downloadinkscape-ec7a928bacad3df202e92b552f50af4dc9e275cb.tar.gz
inkscape-ec7a928bacad3df202e92b552f50af4dc9e275cb.zip
Fix window resize canvas orientation interference
https://bugs.launchpad.net/inkscape/+bug/1792514
Diffstat (limited to 'src')
-rw-r--r--src/widgets/desktop-widget.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index fcb114260..d11943aa7 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -869,6 +869,9 @@ sp_desktop_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
if (gtk_widget_get_realized (widget)) {
Geom::Rect const area = dtw->desktop->get_display_area();
+ Geom::Rect const d_canvas = dtw->desktop->getCanvas()->getViewbox();
+ Geom::Point midpoint = dtw->desktop->w2d(d_canvas.midpoint());
+
double zoom = dtw->desktop->current_zoom();
if (GTK_WIDGET_CLASS(dtw_parent_class)->size_allocate) {
@@ -883,7 +886,7 @@ sp_desktop_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
double newshortside = MIN(newarea.width(), newarea.height());
zoom *= newshortside / oldshortside;
}
- dtw->desktop->zoom_absolute_center_point (area.midpoint(), zoom);
+ dtw->desktop->zoom_absolute_center_point (midpoint, zoom);
// TODO - Should call show_dialogs() from sp_namedview_window_from_document only.
// But delaying the call to here solves dock sizing issues on OS X, (see #171579)