From d9c86888f170593390da648af3ba444acd177d54 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 24 Oct 2017 13:48:52 +0200 Subject: 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). --- src/sp-root.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sp-root.cpp') 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 } } -- cgit v1.2.3