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

Fix spirit level when screen rotated #2999

Closed

Conversation

matijatosic
Copy link
Contributor

Take default rotation/reflection into account, as defined via the Settings app.

@thyttan
Copy link
Collaborator

thyttan commented Sep 7, 2023

Thanks - I'll take a look and be back!

@thyttan
Copy link
Collaborator

thyttan commented Sep 7, 2023

Looking good!

I just have one hold up. Maybe the firmware should take care of rotating the accelerometer readings before passing it on instead, @gfwilliams? Adjacent previous discussion:

Another note: If implemented, would this mess with accelerometer readings?

Right now they are left as-is. I guess it depends what you intended to use the readings for. Step counting/etc would work fine.

Originally posted by @gfwilliams in #1040 (comment)

PRO re rotating in firmware:

  • apps don't have to add code to handle rotation.
  • I guess it should be faster to do the rotation in firmware.

CON re rotating in firmware:

  • adds some overhead for the, I guess overwhelmingly, most common case of not rotating the screen when checking the rotation setting.
  • increases firmware size (negligibly I'd think).

@gfwilliams
Copy link
Member

Yes, I think you're right - we should probably do that in firmware. The hit itself should be minimal, and we do it for touchscreen and I think even accelerometer 'tap' events already.

It's hard to think of any apps that wouldn't benefit from it being flipped - the only one I can think of that uses accelerometer right now is ball maze, but I guess that would be broken at the moment if done on a rotated screen

@gfwilliams
Copy link
Member

Just done :)

@matijatosic matijatosic deleted the spiritlevel-rotation branch September 8, 2023 21:14
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

Successfully merging this pull request may close these issues.

None yet

3 participants