summaryrefslogtreecommitdiffstats
path: root/src/style-internal.cpp
diff options
context:
space:
mode:
authormathog <>2015-05-21 17:23:01 +0000
committermathog <>2015-05-21 17:23:01 +0000
commit9f1c113eb98e7898f14502c69d8e3f7c35664c11 (patch)
treefbf61f7f3e48d64940a6a2b8136177a098768334 /src/style-internal.cpp
parentDon't fill entry box with zeros while typing. Bug introduced with r14160. (diff)
downloadinkscape-9f1c113eb98e7898f14502c69d8e3f7c35664c11.tar.gz
inkscape-9f1c113eb98e7898f14502c69d8e3f7c35664c11.zip
patch bug 1294784
(bzr r14167)
Diffstat (limited to 'src/style-internal.cpp')
-rw-r--r--src/style-internal.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index 0e53da0d3..c117a97f9 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -1931,6 +1931,11 @@ SPIFontSize::read( gchar const *str ) {
unit = length.unit;
value = length.value;
computed = length.computed;
+ /* Set a minimum font size to something much smaller than should ever (ever!) be encountered in a real file.
+ If a bad SVG file is encountered and this is zero odd things
+ might happen because the inverse is used in some scaling actions.
+ */
+ if ( computed <= 1.0e-32 ) { computed = 1.0e-32; }
if( unit == SP_CSS_UNIT_PERCENT ) {
type = SP_FONT_SIZE_PERCENTAGE;
} else {
@@ -2011,6 +2016,11 @@ SPIFontSize::cascade( const SPIBase* const parent ) {
break;
}
}
+ /* Set a minimum font size to something much smaller than should ever (ever!) be encountered in a real file.
+ If a bad SVG file is encountered and this is zero odd things
+ might happen because the inverse is used in some scaling actions.
+ */
+ if ( computed <= 1.0e-32 ) { computed = 1.0e-32; }
} else {
std::cerr << "SPIFontSize::cascade(): Incorrect parent type" << std::endl;
}
@@ -2099,6 +2109,11 @@ SPIFontSize::merge( const SPIBase* const parent ) {
}
}
} // Relative size
+ /* Set a minimum font size to something much smaller than should ever (ever!) be encountered in a real file.
+ If a bad SVG file is encountered and this is zero odd things
+ might happen because the inverse is used in some scaling actions.
+ */
+ if ( computed <= 1.0e-32 ) { computed = 1.0e-32; }
} // Parent set and not inherit
} else {
std::cerr << "SPIFontSize::merge(): Incorrect parent type" << std::endl;