From: Brion Vibber Date: Mon, 12 Sep 2005 19:38:09 +0000 (+0000) Subject: * Fix scaling of non-integer SVG unit sizes X-Git-Tag: 1.6.0~1669 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=7adb4306ec929b1cef7afafe47f953cd839ad9bb;p=lhc%2Fweb%2Fwiklou.git * Fix scaling of non-integer SVG unit sizes --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a7f514ff94..0e4773bbcd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/Image.php b/includes/Image.php index 39acf98483..4bf542e00f 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -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] );