-
Notifications
You must be signed in to change notification settings - Fork 785
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
Introduce basic dithering tool #308
Conversation
grosbouddha
commented
Sep 14, 2015
👍 |
Great time saver, thanks a lot for this. Added a few suggestions in the comments. The last one regarding the PaletteController cleanup can be done in a separate ticket, let me know how you feel about it. |
// Use secondary color otherwise. | ||
// When using the right mouse button, invert the above behavior to allow quick corrections. | ||
var usePrimaryColor = (col + row) % 2; | ||
var invertColors = event.button === Constants.RIGHT_BUTTON; |
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.
We cannot rely on event.button here, because applyToolAt can be triggered by a mousemove event, which will not have the expected 'button' value. (see comment in DrawingController getCurrentColor_).
The only way to know if we are on the right button is to check the color here. Otherwise we could modify the event object passed by the DrawingController to the tools
Edit : I should add this issue only occurs on FF and IE, which is probably why you didn't see it when testing.
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 added a mousedown check in the dithering#applyToolAt method.
Record pressed mouse button type only at mousedown time. On IE/FF, the button type is not available during mousemove. Did a round of testing on both FF and Chrome.
Thanks for addressing the comments. Merging. |
Introduce basic dithering tool