Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stumbled across this just now while helping a new CS teacher come up to speed on one of my former class projects. The project uses a nested loop and the width and height system variables to change the color of each pixel in the pixels array (as described in chapter 15 of Shiffman's "Learning Processing"). As of this change, that same loop only modifies the pixels in a small portion of the display window on my high DPI laptop. It's a nasty little bug if you haven't faithfully kept up with the Processing release notes. Perhaps you could display a warning message to ease folks into it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @agreyson Thanks for your comment! We made this change because sketches looked blurry on high-DPI displays, but as you found out, it can break older code that works with pixels directly. This happens because different pixelDensity values introduce inconsistencies in per-pixel operations. @catilac and @tychedelia are exploring solutions here: #1145, and suggestions are welcome on the issue thread: #1131. Since the fix is more complex than expected, adding a warning message could be a helpful interim step to prevent the headaches you ran into. Thanks for your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @SableRaf. I appreciate the speedy response! Given that this breaks a substantial chunk of @shiffman instructional materials, my recommendation would be to revert #1038 for now, and leave it to knowledgable developers to call pixelDensity explicitly until you've found a solution (easier said than done, judging by the commentary). Thank you for your work on Processing, and best of luck!