fgnass / spin.js

A spinning activity indicator
http://spin.js.org
MIT License
9.3k stars 1.02k forks source link

Pixelated bars since 3.x #355

Closed shllg closed 6 years ago

shllg commented 6 years ago

I updated spin.js lately from 2.3.2 to 3.1.0

Before, the spinner had clean rectangels as bars. Now with the new version they're looking pixelated/without smooth edges.

bildschirmfoto 2018-03-15 um 12 07 36

I tried different options to get rid of those edges - without success.

shllg commented 6 years ago

Before it looked like that:

bildschirmfoto 2018-03-15 um 12 14 08

theodorejb commented 6 years ago

Thanks for the report. It looks like the two screenshots are using different settings (number of lines, length, radius, etc.), which makes it harder to compare them. Can you share the settings used for both screenshots? Also, what browser is this from? Do you notice pixelation in other browsers too?

shllg commented 6 years ago

Yes the settings are slightly different, but changing them doesn't fix the problem (changed the settings and made a new screenshot - see below).

System: MacOS - Chrome / Firefox / Safari all with the same issue

bildschirmfoto 2018-03-18 um 20 28 36

Settings:

lines: 11             # The number of lines to draw
length: 12            # The length of each line
width: 2              # The line thickness
radius: 8             # The radius of the inner circle
scale: 1              # Scales overall size of the spinner
corners: 1            # Corner roundness (0..1)
color: '#000'         # #rgb or #rrggbb or array of colors
opacity: 0.25         # Opacity of the lines
rotate: 0             # The rotation offset
direction: 1          # 1: clockwise, -1: counterclockwise
speed: 1              # Rounds per second
trail: 60             # Afterglow percentage
fps: 20               # Frames per second when using setTimeout() as a fallback for CSS
zIndex: 2e9           # The z-index (defaults to 2000000000)
className: 'spinner'  # The CSS class to assign to the spinner
top: '50%'            # Top position relative to parent
left: '50%'           # Left position relative to parent
shadow: false         # Whether to render a shadow
hwaccel: false        # Whether to use hardware acceleration
position: 'absolute'  # Element positioning
theodorejb commented 6 years ago

I don't have a Mac to test with, but I noticed that rendering the lines with a transparent shadow seems to help in Chrome on Windows. Try setting shadow: '0 0 1px transparent' and see if it makes a difference.

shllg commented 6 years ago

Not i just blurs the edges a little bit. But the problem itself is still there.

bildschirmfoto 2018-03-22 um 11 54 11

(Again different settings but i think you can still see the issue)

shllg commented 6 years ago

Okay, i'm sorry - seems like i were wrong. I ran some comparison with the versions:

bildschirmfoto 2018-03-22 um 13 29 44

Same settings except of the last one with you recommended shadow setting.