New issue
Advanced search Search tips

Issue 812239 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Several consequence wide svg-images with fractional height has random alignment

Reported by pfigh...@gmail.com, Feb 14 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36

Steps to reproduce the problem:
Open https://plnkr.co/edit/qpTwxJMkDmjJ8JWK3UN1?p=preview

What is the expected behavior?
All circles should has equal ident

What went wrong?
Circles has random ident, that depends on:
1) svg vieport width
2) image height (14.1..14.9)
3) way to add svg to page - <img> or inline <svg>

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 64.0.3282.140  Channel: n/a
OS Version: 6.3
Flash Version:
 
plunk-qpTwxJMkDmjJ8JWK3UN1.zip
3.6 KB Download

Comment 2 Deleted

Comment 3 by pfigh...@gmail.com, Feb 14 2018

Updated plunkr, its repro with 1.3em. https://plnkr.co/edit/cAWaJnCc8qZ0djM4LgCe?p=preview
Components: Blink>SVG Blink>Layout
Cc: f...@opera.com
Components: -Blink>Layout
Labels: OS-Android OS-Chrome OS-Linux OS-Mac
Owner: schenney@chromium.org
Status: Assigned (was: Unconfirmed)
Interestingly looks right at 125% zoom. I agree that there seems to be no good reason for rows to get different offsets. At some point I'll figure out why and see if we can do better.

Comment 6 by pfigh...@gmail.com, Feb 15 2018

Discovered, that in Chrome 56.0.2924.87 does not repro.

Comment 7 by f...@opera.com, Feb 15 2018

At 1.25x, 14.3px will be 17.875px "zoomed", which can be represented without precision loss by LayoutUnit. I'd suspect it's the various rounding errors and losses of precision (both intentional and not) that yields this end result. The aspect ratio from the (wide) SVG here is 320:12, which is also not possible to represent exactly for instance - and that will have to be applied to the 14.3px to get the width. Also, IIRC, that computation (the layout) is done with LayoutUnits which when we later paint we snap to pixels (ints) meaning we get a discrepancy in "viewport" the SVG is painted in.

Comment 8 by pfigh...@gmail.com, Feb 19 2018

Hey, I found solution. Just add preserveAspectRatio="xMinYMin meet"
See there https://plnkr.co/edit/X2kViPNJzrJpumYEXiRU?p=preview

Sign in to add a comment