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

fixed position being applied twice in Pencil.draw_filled_rect() #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lunasoldev
Copy link

The original code has the position input being applied 2x due to first moving the origin and then drawing with it as an offset.

@lemunozm
Copy link
Owner

lemunozm commented Jan 7, 2025

This is expected at least by the current API. The origin simply sets the origin of the canvas from where you want to draw. Later, the position sets the origin of the rectangle in that origin. If you want to draw from the origin, you can simply set position == (0,0)

@lunasoldev
Copy link
Author

lunasoldev commented Jan 27, 2025

This is expected at least by the current API. The origin simply sets the origin of the canvas from where you want to draw. Later, the position sets the origin of the rectangle in that origin.

Yes, but it applies the same offset two times in a row, resulting in the rectangle being drawn in the coordinates with double the distance to the origin

To the resetting the position at the end, i will fix this and create a new PR

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.

2 participants