diff --git a/TODO.md b/TODO.md index 24fcdcb..b22cdc0 100644 --- a/TODO.md +++ b/TODO.md @@ -58,8 +58,6 @@ then switch back to the magnifier, the toolbar doesn't show any magnification hi * Can't glide thru tool options in Firefox, mobile Chrome; might be a pointer events spec interpretation issue, and it could easily be that the more technically correct browsers are where it's not working (Note: not a thing allowed by MS Paint) -* Middle-click scrolling is prevented -(Note: not a thing allowed by MS Paint) ### Menus diff --git a/src/Selection.js b/src/Selection.js index 30c8b31..5734855 100644 --- a/src/Selection.js +++ b/src/Selection.js @@ -96,7 +96,7 @@ Selection.prototype.cut_out_background = function(){ var sel = this; var cutout = sel.canvas; if(transparency){ - // @FIXME: this doesn't work well with transparency between 0 and 1 + // @FIXME: this doesn't work well with nonbinary transparency ctx.save(); ctx.globalCompositeOperation = "destination-out"; ctx.drawImage(cutout, sel.x, sel.y); diff --git a/src/app.js b/src/app.js index bad9652..6f8e457 100644 --- a/src/app.js +++ b/src/app.js @@ -583,6 +583,9 @@ $app ){ return; } + if(e.button === 1){ + return; // allow middle-click scrolling + } e.preventDefault(); }); diff --git a/src/tools.js b/src/tools.js index 36acf32..3216011 100644 --- a/src/tools.js +++ b/src/tools.js @@ -473,6 +473,10 @@ tools = [{ ctx.fillRect(x, y, w, h); } if(this.$options.stroke){ + // FIXME: can draw 1x2 or 2x1 pixels of a rectangle with a stroke of 1px (the default) + // which doesn't get drawn at full opacity + // or more generally, a 0-width or 0-height rectangle gives + // non-full-opacity pixels at either side of the resulting line drawn if((stroke_size % 2) === 1){ ctx.strokeRect(x-0.5, y-0.5, w, h); }else{