wokwi / wokwi-elements

Web Components for Electronics and IoT Parts
https://elements.wokwi.com/
MIT License
185 stars 50 forks source link

Visual glitch in potentiometer #133

Closed Koepel closed 2 years ago

Koepel commented 2 years ago

When a potentiometer is turned with the mouse, the marker sometimes jitters to a other position. It seems to happen in every browser.

There are two positions that cause it, and the marker always jumps to the minimum or maximum position. It might take some time to find the glitch, but all three examples in the documentation have it: https://docs.wokwi.com/parts/wokwi-potentiometer

glitch1

glitch2

When the potentiometer is rotated, the marker does not follow the mouse cursor. It also has that glitch.

afbeelding (The PrintScreen changed the cursor, it was a hand with pointing finger)

urish commented 2 years ago

Thanks for reporting! Can you please check again now?

Koepel commented 2 years ago

It has changed, but it is still there. When the mouse cursor is at 9 o'clock, then the marker jumps to the maximum.

https://user-images.githubusercontent.com/12096541/180612642-4a471d98-50bf-485c-9016-0f807729886a.mp4

Not only the marker glitches, also the analogRead() and the ADCW register return 1023 when the marker jumps to the maximum.

The marker does not follow the mouse cursor when the potentiometer is rotated.

urish commented 2 years ago

How about now?

Koepel commented 2 years ago

I'm sorry, I meant to reply here, but I replied at: https://github.com/wokwi/wokwi-elements/issues/70#issuecomment-1193365746 Issue https://github.com/wokwi/wokwi-elements/issues/87 is something else in my opinion.

Latest tests: Works good without glitch and also rotated in: Chrome, Chromium, Edge, Vivaldi. In Windows and linux. The potentiometer can no longer be used with Firefox in Windows and linux. The Gnome Web browser (based on WebKitGTK) has no glitch, but a rotated potentiometer can not be used, although the marker moves a little. The PaleMoon browser does not show the circuit diagram of Wokwi, as we know. Nothing changed there. Browser Falkon does also not show the circuit diagram.

urish commented 2 years ago

Thanks for the detailed tests!

It reproduces here.

I think #87 has the same underlying cause as what we're observing here - Firefox not implementing getScreenCTM() the same way other browsers do. They have an open issue about it.

urish commented 2 years ago

It was a real PITA, but I think I finally figured out how to make it work in Firefox.

Can you give it another try, please?

Koepel commented 2 years ago

It is now working here as well in Firefox. Thank you.

The Gnome Web browser (based on WebKitGTK) has still troubles turning the knob. The WebKit is also used in Safari, but I can not test that.

urish commented 2 years ago

Thanks for testing! Applied the same workaround for Epiphany, let's see if it does the trick

Koepel commented 2 years ago

Firefox works with the sliding potentiometer now. The Gnome "Web" browser (Epiphany) has still trouble with the rotated round potentiometer. Perhaps that needs attention in a other issue. This issue is fixed. Thank you.