Started handling pivot buttons

This commit is contained in:
unsettledgames
2020-09-13 11:21:23 +02:00
parent a56c9576a9
commit d8cfd14ded
4 changed files with 27 additions and 12 deletions

View File

@ -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;

View File

@ -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<buttons.length; i++) {
buttons[i].addEventListener("click", changePivot);
}
}
function changePivot(event) {
console.log("sas");
console.log(event.target);
}
// Use a dialogue