Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meter.cpp re-initialisation fails to draw needle #19

Open
nottledim opened this issue May 13, 2024 · 0 comments
Open

Meter.cpp re-initialisation fails to draw needle #19

nottledim opened this issue May 13, 2024 · 0 comments

Comments

@nottledim
Copy link

If you re-initialise (1) the meter using MeterWidget::analogMeter method then it doesn't draw the needle - expected to be at zero (2). The reason is the value old_analog is only set in the constructor after which it gets updated to the value of the needle. If that's zero the needle draw function is skipped as there is no change in needle value.
The solution is to initialise old_analog to -999 in the analogMeter method.

  1. it's quite cool; you can place a number of meters on the same display location and step through them with buttons or gestures.
  2. I think there's a case for an initial needle value for the analogMeter method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant