From cc460446b6405745fb3e8af57ac9252b28ccaf40 Mon Sep 17 00:00:00 2001 From: Nicola <47360416+unsettledgames@users.noreply.github.com> Date: Sun, 23 Jan 2022 13:32:23 +0100 Subject: [PATCH] Finished ellipse tool --- js/Util.js | 31 +++++++++++++++++++++++++++++++ js/tools/EllipseTool.js | 20 ++++++++++++++++---- js/tools/FillTool.js | 11 +++++++---- js/tools/SelectionTool.js | 23 +---------------------- 4 files changed, 55 insertions(+), 30 deletions(-) diff --git a/js/Util.js b/js/Util.js index 6705ada..a6ba566 100644 --- a/js/Util.js +++ b/js/Util.js @@ -1,6 +1,37 @@ // Acts as a public static class class Util { + /** Pastes the source image data on the destination image data, keeping the pixels where the + * source image data is transparent + * + * @param {*} source + * @param {*} destination + */ + static pasteData(underlyingImageData, pasteData, finalContext) { + for (let i=0; i