From d274679c013d1fc14757be4db4d1e9f6470a2214 Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Thu, 18 Jan 2018 01:56:44 -0500 Subject: [PATCH] Update TODOs --- TODO.md | 6 ++++-- src/Selection.js | 4 ++++ src/app.js | 3 +++ src/tools.js | 3 ++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index 9b130e1..1ddab3a 100644 --- a/TODO.md +++ b/TODO.md @@ -49,7 +49,9 @@ ### Issues +* [Selection is not included in the image when you save (it should deselect)](https://github.com/1j01/jspaint/issues/14) * ["Quick Undo" stopped working in Chrome](https://github.com/1j01/jspaint/issues/9) +* [Resizing the canvas or selection is broken when magnified](https://github.com/1j01/jspaint/issues/13) * If you open an image it resets the zoom but if you're on the magnification tool it doesn't update the options * If you zoom in with the magnifier without previously changing the magnification on the toolbar, then switch back to the magnifier, the toolbar doesn't show any magnification highlighted @@ -126,7 +128,7 @@ might be a pointer events spec interpretation issue, and it could easily be that * Enlarge GUI elements on touch devices * Menus - * Resize handles + * Resize handles (at least functionally; in Win7 Paint, the hitbox size is much larger than the visible size, like maybe 32px) * You can't use the Eraser/Color Eraser tool as a "Color Eraser" without a secondary mouse button @@ -211,7 +213,7 @@ might be a pointer events spec interpretation issue, and it could easily be that * Selection * Proportionally resize selection while holding Shift - (or maybe by default? I feel like it should be the default.) + (or maybe by default? I feel like it should be the default, tbh.) * Don't cut until you drag or do something else (In MS Paint, you can make a selection, change the background color and drag it, leaving the new background color behind.) diff --git a/src/Selection.js b/src/Selection.js index 3aefcf6..bfac31d 100644 --- a/src/Selection.js +++ b/src/Selection.js @@ -168,6 +168,10 @@ Selection.prototype.cut_out_background = function(){ // (and it would be complicated to make it update the canvas when switching tool options (as opposed to just the selection)) // I'm having it use the transparent_opaque option here, so you could at least choose beforehand // (and this might actually give you more options, although it could be confusingly inconsistent) + // FIXME: yeah, this is confusing; if you have both transparency modes on and you try to clear an area to transparency, it doesn't work + // and there's no indication that you should try the other selection transparency mode, + // and even if you do, if you do it after creating a selection, it still won't work, + // because you will have already *not cut out* the selection from the canvas if(!transparency || transparent_opaque=="transparent"){ ctx.drawImage(colored_canvas, sel.x, sel.y); } diff --git a/src/app.js b/src/app.js index 6f8e457..f83ffb2 100644 --- a/src/app.js +++ b/src/app.js @@ -379,6 +379,9 @@ $G.on("cut copy paste", function(e){ item.getAsString(function(text){ // parse text/uri-list (might as well do it properly) var uris = text.split(/[\n\r]+/).filter(function(line){return line[0] !== "#" && line}); + // TODO: check that it's actually a URI, + // and if text/plain maybe silently ignore the paste + // but definitely generally show a better error than show_resource_load_error_message() load_image_from_URI(uris[0], function(err, img){ if(err){ return show_resource_load_error_message(); } paste(img); diff --git a/src/tools.js b/src/tools.js index de88d3c..08a8ac8 100644 --- a/src/tools.js +++ b/src/tools.js @@ -25,7 +25,8 @@ tools = [{ // End prior selection, drawing it to the canvas deselect(); // Checkpoint so we can roll back inverty brush - // @TODO Still probably need to use something other than the undo stack + // XXX: Shouldn't use the undo stack for this at all! + // TODO: Create an OnCanvasObject for the inverty brush, and make selection a passive action undoable(); // The inverty brush is continuous in space which means