Hairline gap when scaling down SVG for use as bg image |
||||
Issue descriptionOn Chrome on Android I've used SVGs as background images (which use viewBox and are scaled down to fit to their element) on https://developer.chrome.com/devsummit As you can see from the attached screenshot there are hairline cracks where they adjoin the neighboring element, breaking the overall effect. I've tried moving the element a little, adding borders, but I'm wondering if there's some kind of rounding error related to dPR when scaling down the SVG?
,
Sep 5 2016
,
Sep 5 2016
It's on a Nexus 5X, which reports a dPR of 2.625
,
Sep 6 2016
This is almost certainly a pixel snapping issue with background images. It may not be SVG at all.
,
Sep 6 2016
The issue is the sizing of the :after elements, or maybe the sizing of the divs, but the net effect is that the :after edges and the background image in the div do not line up exactly. If you look at the lower hairline you can see that the background image of the div is there in the hairline, so it's the :after that is too small or the div that is too big. So it's conceivable that this is a layout problem. Also, it doesn't repro on DevTools device emulation on desktop, but I do see it on Nexus5x.
,
Feb 22 2017
I run into the same problem with a different layout: just absolute positioned SVGs on top of a coloured background. Here's a pen showing the problem: http://codepen.io/spite/full/dNEZyP/ It doesn't happen on chrome desktop (although i have reports of people getting the thin line by changing the zoom with pinch-zoom on OSX), but it does happen on Safari, Firefox (Win, OSX, Linux, Android) and Edge. If it doesn't happen for a specific window size, resizing or generally changing the viewport shows that result.
,
Mar 9 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 9 2018
The page is gone, of course. Out test for SVG having hairline cracks was fixed when I switched to painting to the border rect, so I think we might have fixed this one too. Regardless, not actionable now. |
||||
►
Sign in to add a comment |
||||
Comment 1 by f...@opera.com
, Sep 5 2016