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

Shift speed display over when >= 100 so it doesn't overlap gauges #10

Closed
wants to merge 1 commit into from

Conversation

pyjamasam
Copy link
Collaborator

When the speed is 100 or greater (happens a bunch for us KM/h drivers) the speed overlaps the gauges on the right. This code will shift the speed label over.

@pyjamasam pyjamasam requested a review from nmullaney April 3, 2022 01:26
@nmullaney
Copy link
Owner

It might make more sense to just scaleX when there are 3 digits. You might have to rescale Y to account for this (since it's already scaled to .9).

@nmullaney
Copy link
Owner

Another possible fix would be to change the constraints so that the speed is constrained by the gauges. That would require making the gauge labels fit their contents a bit tighter which might be a bit tricky.

@pyjamasam
Copy link
Collaborator Author

So I though about both those solutions, but in the first case (the scaling) the text doesn't really need to get any smaller... It just needs to slide over a tiny bit. Since the 1 at the start of the speed doesn't really take up an entire "space" we can cheat that way. I mean if somebody is doing 200+ (maybe KM/h might be possible... but MPH seems a long way off hahah)

I had started playing with the constraints but it seemed a like it was gonna be a bigger and more involved change.

While I realize this commit is sorta what I would consider a hack, it makes the display look far less janky for people using metric speeds. Maybe we can look at it as a "good enough for now" fix while we keep working on a more proper fix?

Copy link
Owner

@nmullaney nmullaney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that's reasonable. Let's get it in as a good enough for now fix. Can you update the existing task (or open a new one) for a more permanent fix (probably fixing the constraints)?

@nmullaney
Copy link
Owner

I think we should probably close this in favor of #15

@pyjamasam
Copy link
Collaborator Author

Yup. I am all for that.

@pyjamasam pyjamasam closed this Apr 8, 2022
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

2 participants