We are about to switch to a new forum software. Until then we have removed the registration on this forum.
We're working on some code that builds LED layouts based on SVG files, and encountered something strange.
On my Windows 10 machine, the origin is approximately 25 pixels above the start of the output window. There are no transform methods, matrix transformations, or rectMode statements that would cause something like this. Even stranger, running the same code on OSX displays correctly.
screenshot: http://prntscr.com/gcaejgs The rect in the top right is being constructed by rect(0,0,50,50); for testing purpose.
The code in question is here: https://github.com/PWRFLcreative/Lightwork-Scraper It should run regardless of whether there's a fadecandy driving LEDs on the network.
Has anyone encountered something like this?
Answers
I haven't inspected or tested the code, but possibly related: I notice you have an "int margin = 50" argument in your header, and you are using it in Scraper.pde.
https://github.com/PWRFLcreative/Lightwork-Scraper/blob/master/LightWork_Scraper/Scraper.pde#L56
Yeah, the margin is used in normalizing/scaling the svg points to the output window. It's there to make sure the points are all inside the visible output.
That value isn't being used on the rectangle, though. It's still appearing above the canvas for some reason.
So, an update:switching the renderer to JAVA2D rather than P2D has it displaying correctly. Both work fine on OSX. Perhaps a renderer bug?
Thanks for posting your solution!
If you have a minimal (MCVE) sketch that demonstrates the issue along with the screenshot, consider checking if an issue is already open here:
...and if not, reporting it.