-
Notifications
You must be signed in to change notification settings - Fork 11
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
FilledTriangle stretches too far horizontally #9
Comments
At first glance the code seems ok, could you output the coordinates of the points to see if the error might be there? Which display are you using? I have drawn a few different clocks and gauges myself and don't remember any issue, but also don't remember setting it to 3-9 o'clock either. Code was based on Adafruit's GFX library https://github.com/adafruit/Adafruit-GFX-Library/blob/master/Adafruit_GFX.cpp#L619-L701 will check the implementation when possible. |
Okay, let me take a deeper look at it this weekend, and I'll see if I can find the exact inputs that reproduce the problem. |
I've also noticed some anomalies when filling triangles. I initally assumed this was due to the display driver I was implementing but I suspect something is wrong in tinydraw. I'll see if I can create a reproducible test. |
No longer crashes due to #11. And it seems that souce code: |
I created a pull request that re-uses the line drawing algorothm for filling the triangles unfortunately the changes were more significant than I anticipated when I started down this path. #12 |
I created an additional pull request with some tests that reproduce the rendering issues. #13 |
I finally spotted an additional error in the translation from c to go code. I should have noticed it with my fix for issue11 but somehow missed it. See #13 The rendering is in my opinion not as good as the changes I made in #12 but the change is much much simpler and easier to verify against the original code. I'll leave it to the maintainers to decide which approach to take. |
I was using a FilledTriangle to draw the hands on a clock, and I noticed that the triangle for the minute hand goes outside the boundaries of the clock near the 3 o'clock and 9 o'clock positions.
Assuming there is nothing wrong with math.Sincos(), I can only assume that something is not quite right with FilledTriangle().
My logic looks something like this:
The text was updated successfully, but these errors were encountered: