diff --git a/src/js/tools/drawing/DitheringTool.js b/src/js/tools/drawing/DitheringTool.js index 7477fdf9..505cf86b 100644 --- a/src/js/tools/drawing/DitheringTool.js +++ b/src/js/tools/drawing/DitheringTool.js @@ -17,12 +17,17 @@ * @override */ ns.DitheringTool.prototype.applyToolAt = function(col, row, color, frame, overlay, event) { + // On Firefox/IE, the clicked button type is not part of the mousemove event. + // Ensure we record the pressed button on the initial mousedown only. + if (event.type == 'mousedown') { + this.invertColors_ = event.button === Constants.RIGHT_BUTTON; + } + // Use primary selected color on cell with either an odd col or row. // 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; - usePrimaryColor = invertColors ? !usePrimaryColor : usePrimaryColor; + usePrimaryColor = this.invertColors_ ? !usePrimaryColor : usePrimaryColor; var selectedColors = pskl.app.selectedColorsService.getColors(); var ditheringColor = usePrimaryColor ? selectedColors[0] : selectedColors[1];