From bcb4593d44f1e06e902b0e99aeb0a6e579eb40e7 Mon Sep 17 00:00:00 2001 From: tim h Date: Sat, 19 Nov 2022 13:49:25 -0600 Subject: [PATCH] fixes issue 8 --- README.md | 2 +- js/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 201b9de..a348d98 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ please do! kindly indicate your OS, browser, versions of both, any errors in dev - generated images display +1px on x/y during approve/reject state, doesn't affect output, just annoying - erase mask is like entirely broken - odd-numbered scale factors don't snap correctly - - arbitrary "pasted" images require clicking twice to place them and i _don't know why_ [(yes i do)](#terrible), just getting them to be arbitrarily placable was a giant pain because i'm not got the smarts + - ~~arbitrary "pasted" images require clicking twice to place them and i _don't know why_ [(yes i do)](#terrible), just getting them to be arbitrarily placable was a giant pain because i'm not got the smarts~~ - selecting an aribtrary image by double-clicking it in the file picker can sometimes trigger a dream request that errors out if your file picker is "above" the canvas; i tried to alleviate that by temporarily removing the mouse(move/down/up) handlers for the canvas context on selection of a file, but i'm POSITIVE it's an improper solution and not quite sure if it's even fully effective ## warranty diff --git a/js/index.js b/js/index.js index 64620d0..1262fc2 100644 --- a/js/index.js +++ b/js/index.js @@ -137,10 +137,10 @@ function startup() { function drop(imageParams) { const img = new Image(); - img.src = arbitraryImageBase64; - if (img.complete) { + img.onload = function () { writeArbitraryImage(img, imageParams.x, imageParams.y) } + img.src = arbitraryImageBase64; } function writeArbitraryImage(img, x, y) {