From d8cfd14ded163a9449b119ccce431f6f8e1e4681 Mon Sep 17 00:00:00 2001 From: unsettledgames <47360416+unsettledgames@users.noreply.github.com> Date: Sun, 13 Sep 2020 11:21:23 +0200 Subject: [PATCH] Started handling pivot buttons --- css/pixel-editor.scss | 2 +- js/_getCursorPosition.js | 2 -- js/_resizeCanvas.js | 17 +++++++++++++++++ views/pixel-editor.hbs | 18 +++++++++--------- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/css/pixel-editor.scss b/css/pixel-editor.scss index c78a388..8602d08 100644 --- a/css/pixel-editor.scss +++ b/css/pixel-editor.scss @@ -967,7 +967,7 @@ svg { position:relative; width:40px; height:40px; - background:color(menu, background); + background-color:color(base, background); border:none; path { diff --git a/js/_getCursorPosition.js b/js/_getCursorPosition.js index d4addcc..9a0d1d1 100644 --- a/js/_getCursorPosition.js +++ b/js/_getCursorPosition.js @@ -6,8 +6,6 @@ function getCursorPosition(e) { if (e.pageX != undefined && e.pageY != undefined) { x = e.pageX; y = e.pageY; - - console.log("passato di qui"); } else { x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; diff --git a/js/_resizeCanvas.js b/js/_resizeCanvas.js index 16cf7be..a1eed54 100644 --- a/js/_resizeCanvas.js +++ b/js/_resizeCanvas.js @@ -2,6 +2,23 @@ let resizeCanvasContainer = document.getElementById("resize-canvas"); function openResizeCanvasWindow() { showDialogue('resize-canvas'); + console.log("aperta"); + initButtons(); +} + +function initButtons() { + let buttons = document.getElementsByClassName("pivot-button"); + + console.log("length: " + buttons.length); + + for (let i=0; i - - - - - - - - - + + + + + + + + +