* Fix scaling of non-integer SVG unit sizes
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 12 Sep 2005 19:38:09 +0000 (19:38 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 12 Sep 2005 19:38:09 +0000 (19:38 +0000)
RELEASE-NOTES
includes/Image.php

index a7f514f..0e4773b 100644 (file)
@@ -93,6 +93,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 3127) Render large SVGs at image page size correctly
 * Fix regressions in ChangesList traditional layout
 * Fix edit on double-click for move-protected pages in Classic skin
+* Fix scaling of non-integer SVG unit sizes
 
 
 === Caveats ===
index 39acf98..4bf542e 100644 (file)
@@ -1670,7 +1670,7 @@ function wfScaleSVGUnit( $length ) {
                ''   => 1.0, // "User units" pixels by default
                '%'  => 2.0, // Fake it!
                );
-       if( preg_match( '/^(\d+)(em|ex|px|pt|pc|cm|mm|in|%|)$/', $length, $matches ) ) {
+       if( preg_match( '/^(\d+(?:\.\d+)?)(em|ex|px|pt|pc|cm|mm|in|%|)$/', $length, $matches ) ) {
                $length = floatval( $matches[1] );
                $unit = $matches[2];
                return round( $length * $unitLength[$unit] );