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

Avoid negative text size in P.3.0 #1

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

Conversation

eric-brechemier
Copy link

I wrapped the difference in a call to abs() to avoid ending up with
a negative text size when the mouse is in the left part of the screen.

The behavior of textSize() with negative values in unspecified;
starting the sketch with the mouse in the left part of the canvas,
I observed first a downward letter A, scaled according to the cursor
horizontal position, then flipped in upright position when the mouse
crosses the middle of the canvas; from this point, whenever the cursor
is in the left part of the canvas, the letter's height is fixed to
a small value, which no longer changes according to horizontal position.

I wrapped the difference in a call to abs() to avoid ending up with
a negative text size when the mouse is in the left part of the screen.

The behavior of textSize() with negative values in unspecified;
starting the sketch with the mouse in the left part of the canvas,
I observed first a downward letter A, scaled according to the cursor
horizontal position, then flipped in upright position when the mouse
crosses the middle of the canvas; from this point, whenever the cursor
is in the left part of the canvas, the letter's height is fixed to
a small value, which no longer changes according to horizontal position.
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.

1 participant