uPlot icon indicating copy to clipboard operation
uPlot copied to clipboard

small visual artifact in legend

Open fquirin opened this issue 3 years ago • 7 comments

Just a small visual artifact I noticed while playing with the legend in Chrome: background-clip-artifact

Due to the background-clip CSS property of .u-legend .u-marker some screens might show this. I guess it depends on screen resolution. I suggest to get rid of background-clip and use outline instead of border (with some size tweaking) for the dynamically generated inline style. This way you can still support transparent colors.

Great work so far :+1: Florian

fquirin avatar Dec 18 '20 16:12 fquirin

oof. i use the same strategy for hover points.

might have to switch to box-shadow instead of outline, since outlines cannot have a radius. but then we lose border-style/dash support.

https://stackoverflow.com/questions/5394116/outline-radius

i wonder how easy this is to trigger 🤔

leeoniya avatar Dec 18 '20 16:12 leeoniya

i'd probably recommend disabling background-clip on a case-by-case basis (really it's there to allow for semi-transparent or dashed borders that are not tainted by the background color (due to box-sizing border-box)).

in the meantime it's worth reporting this to chrome team with a simple repro. they've solved bugs i've reported pretty consistently. some related to paint/box-shadow clipping.

https://bugs.chromium.org/p/chromium/issues/list?q=leeoniya&can=1

leeoniya avatar Dec 18 '20 16:12 leeoniya

Damn I forgot about the border-radius :see_no_evil: ... but I noticed something: border-radius: 1px or anything other than 0 removes the artifact :facepalm: :sweat_smile: ... I guess this could be the easy way out for now.

fquirin avatar Dec 19 '20 08:12 fquirin

let's see where this goes: https://bugs.chromium.org/p/chromium/issues/detail?id=1160941

leeoniya avatar Dec 21 '20 20:12 leeoniya

got marked as a dupe of a regression that's been open for over a year :(

https://bugs.chromium.org/p/chromium/issues/detail?id=1000600

leeoniya avatar Dec 23 '20 21:12 leeoniya

I guess this means it will take an arbitrary amount of time to get fixed :grimacing:

Btw, I've updated lazy with a new 'AutoSeries' feature (used in example2) to simplify creating charts that get new data each x seconds but should show only N data points at the same time :-)

fquirin avatar Dec 26 '20 22:12 fquirin

#431 will probably close this issue out.

leeoniya avatar Jan 13 '21 20:01 leeoniya