summaryrefslogtreecommitdiffstats
path: root/src/sp-root.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2017-10-24 11:48:52 +0000
committerTavmjong Bah <tavmjong@free.fr>2017-10-24 11:48:52 +0000
commitd9c86888f170593390da648af3ba444acd177d54 (patch)
treef7f79fbb278001eaeab539898ae519367cc6fd9a /src/sp-root.cpp
parentUI: Fix canvas scrollbar width a little (diff)
downloadinkscape-d9c86888f170593390da648af3ba444acd177d54.tar.gz
inkscape-d9c86888f170593390da648af3ba444acd177d54.zip
Give drawing a reasonable(?) default size if dimensions are in % and there is no view box.
This prevents a GTK3 crash in file preview (#1611672).
Diffstat (limited to 'src/sp-root.cpp')
-rw-r--r--src/sp-root.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sp-root.cpp b/src/sp-root.cpp
index 9ea1aa976..3f31588cc 100644
--- a/src/sp-root.cpp
+++ b/src/sp-root.cpp
@@ -245,12 +245,12 @@ void SPRoot::setRootDimensions()
} else {
- if( !this->width._set ) {
- this->width.set( SVGLength::PX, 100, 100 ); // Random default
+ if( !this->width._set || this->width.unit == SVGLength::PERCENT) {
+ this->width.set( SVGLength::PX, 300, 300 ); // CSS/SVG default
}
- if( !this->height._set ) {
- this->height.set( SVGLength::PX, 100, 100 ); // Random default
+ if( !this->height._set || this->height.unit == SVGLength::PERCENT) {
+ this->height.set( SVGLength::PX, 150, 150 ); // CSS/SVG default
}
}