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

Screen relative movements are inaccurate #412

Closed
markwheeler opened this issue Jun 9, 2018 · 2 comments
Closed

Screen relative movements are inaccurate #412

markwheeler opened this issue Jun 9, 2018 · 2 comments
Labels
Milestone

Comments

@markwheeler
Copy link
Collaborator

@markwheeler markwheeler commented Jun 9, 2018

screen.move_rel(0, 0) causes things to move a little on both axes. It seems like all relative movements are slightly offset.
Similar error in screen.line_rel()

@tehn
Copy link
Member

@tehn tehn commented Jun 9, 2018

@markwheeler

indeed there's a bug: https://github.com/monome/norns/blob/master/matron/src/hardware/screen.c#L255

this command shouldn't have the 0.5,0.5 offset. and many other similar bugs can be fixed.

so the issue is the "center" of the pixel is offset by 0.5,0.5. if you use 0,0 it's the "corner" of the pixel and the color will be darker as a result of anti-aliasing an off-center coordinate.

so it seems when typing up the lib i blindly applied this rule to a bunch of stuff that wasn't supposed to have it applied. particularly the _rel commands.

@pq pq added the bug label Jun 9, 2018
@markwheeler
Copy link
Collaborator Author

@markwheeler markwheeler commented Jun 9, 2018

Ah yep I see. Looks like this applies to rect and arc also. I would expect screen.rect(0,0,1,1) to draw the top leftmost pixel but I have to offset by -0.5 on both axes to get it there.

@catfact catfact added the screen label Jun 9, 2018
@simonvanderveldt simonvanderveldt added this to the 1.0.2 milestone Jun 13, 2018
@tehn tehn closed this in #423 Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants