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

Introduce basic dithering tool #308

Merged
merged 4 commits into from
Sep 15, 2015
Merged

Introduce basic dithering tool #308

merged 4 commits into from
Sep 15, 2015

Conversation

grosbouddha
Copy link
Collaborator

image

@captainbrosset
Copy link
Contributor

👍

@juliandescottes
Copy link
Collaborator

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;
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.
@juliandescottes
Copy link
Collaborator

Thanks for addressing the comments. Merging.

juliandescottes added a commit that referenced this pull request Sep 15, 2015
@juliandescottes juliandescottes merged commit 5367c75 into master Sep 15, 2015
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.

3 participants