Closed
Bug 535185
Opened 15 years ago
Closed 15 years ago
Unexpected results when scaling SVG patterns by non-integer amounts
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: M8R-mt57m6, Assigned: longsonr)
References
()
Details
Attachments
(3 files)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) When scaling SVGs with patterns, scaling by non-integer amounts can produce inconsistent results. For example, in the attatched test case, there are two patterns - one size 3x5 and the other size 1x1. The two patterns which match up when scaled using <g transform="scale(10 -10)"> or when scaled using <g transform="scale(9 -9)"> but will fail to match up when <g transform="scale(9.5 -9.5)"> is used. This also happens when zooming in Firefox using View->Zoom or Ctrl++/Ctrl+- Reproducible: Always Steps to Reproduce: 1. View http://michaelt.uwcs.co.uk/firefoxSvgBug/grid-scale-testcase.svg 2. Compare top and bottom grids to middle grid. 3. Zoom in/out using Ctrl++/Ctrl+- and observe changes. Actual Results: Black and grey grids do not scale by the same amount, and do not line up over larger distances. Expected Results: Black and grey grids to scale by the same amounts, and hence to remain lined up. This may indicate a premature conversion to pixels/rounding - that is, the 1-wide pattern rounds to (1*9.5=9.5) 9 pixels wide and tiling, so 24 repititions cover 216 pixels; while the 3-wide pattern rounds to (3*9.5=29.5) 29 pixels wide so 8 repetitions cover 232 pixels. If this is the cause, the solution would be to calculate the tiling before performing rounding.
Assignee | ||
Comment 3•15 years ago
|
||
Any scaling applies as the pattern is used so I don't know how to create a reftest that isn't broken without the patch.
Assignee: nobody → longsonr
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #418502 -
Flags: review?(roc)
Attachment #418502 -
Flags: review?(roc) → review+
Assignee | ||
Comment 4•15 years ago
|
||
checked in http://hg.mozilla.org/mozilla-central/rev/3b14d01ce960
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 5•12 years ago
|
||
This appears to be broken again for me in FF 12.0. Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:12.0) Gecko/20100101 Firefox/12.0
Assignee | ||
Comment 6•12 years ago
|
||
Works OK for me, although I'm on Windows.
Comment 7•12 years ago
|
||
See also: - https://bugs.webkit.org/show_bug.cgi?id=74851 - https://code.google.com/p/chromium/issues/detail?id=130326
Comment 8•12 years ago
|
||
I can confirm that the bug is still present on MacOS (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20100101 Firefox/12.0) and fixed on Linux (Mozilla/5.0 (X11; Linux i686 on x86_64; rv:12.0) Gecko/20100101 Firefox/12.0).
Assignee | ||
Comment 9•12 years ago
|
||
Please raise another bug and add testcases and screenshots there.
You need to log in
before you can comment on or make changes to this bug.
Description
•