From 11337b689b7c361c8727c46ffcbb9008b64d3992 Mon Sep 17 00:00:00 2001 From: unsettledgames <47360416+unsettledgames@users.noreply.github.com> Date: Wed, 4 Mar 2020 12:42:15 +0100 Subject: [PATCH] Added possibility to select the rectangular selection tool The user can now select the rectangular selection tool. Deleted the m shortcut for the pan tool and used it to shortcut to the rectangular selection tool. The pan tool can already be selected with the p button. --- images/rectselect.png | Bin 0 -> 6101 bytes js/_hotkeyListener.js | 10 +++++++--- js/_toolButtons.js | 5 +++++ views/pixel-editor.hbs | 5 +++++ 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 images/rectselect.png diff --git a/images/rectselect.png b/images/rectselect.png new file mode 100644 index 0000000000000000000000000000000000000000..3ed7407183024a4f674f11b8fbdf89d9b4ab7f0b GIT binary patch literal 6101 zcmd5=do=Xv(?e4c0T{p`KJR~$}Q zi)@wM3IKqJ%~1;{0Dyu`D1d;0m3Pdp7_fo`W9_g2P?v{X^@D?bbih$3I{-*h0RVg! z0PsK(eg**Iv;ctZ3jhX103a28pXz7?GNAs)tt|kc>Y9=^*xM3))cqU)h<0ui$nE{2 zJ3*pQtc{(e(6j&yDI+_zSORK6mDyNeT@skH``PJYJzxeI_>3 zhG|u;S{du#SdOz6A)gp|YimABm$7@}&$~?M*B8B_U>B-#s^$T7R>$dqbf~P8A!Rk& z1Z_dO>11VEhV0dRqf(>U+w+4ZzyH(rhmrQ#7vO!6uAnro#h&5ND$uMy(QjU(okk?)Oy>RY9 zY)3g~r&szFFUCGFzP$3BioGm)yPl-Ntk_@EtI?&*RtvSc+@+vVuPNhAs1YguK{n^* zc+}*cpWP<6FV0a?*`V||rT0=ilk3k)#+3@y^qvn3dYjJA%hT*@)RZG8emY|>H|)fD z<&{J~1Bxfnsj&%PJQ^@fo&`0z@#STYW}+U&*q)>GUbb$&H%q>9$5U#~%IrVHn-Ne?@N4CxmqrN%xoHhM<<~4xs@(}wvme`?c9Grf0lb_nAb#*)l)4y(q$;*r zbHuDKHug}LA)9W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fmf>a4!VU)ZTnEI7VDGjGDBfd? zs9BW5@0~&be|(_yy*V@qL;H5~4ndDV5YqK+y6qeR+Y zQ+J;&cRy-V0>pc(7K#%*}2w)r4CupV}YO3jYD(co!i)^OqbRjH+Pd3-zo# z0It@zLE2&pdMr@bB53kBg7F1XIWWFs1Gmv6i2E08QtLAmjf%`P1g`BiU9-LNdhl?ctZfpVMW__!hXu(@vb?-P>cyg|Edzu`KWtSIzDGB zv<-}FC%Fin4+3a)c^3>j3l*PtlE8wl1D7SBih7o?4fCy|;o{PrTWEeDUgPIY&&Utc zi$Hq=giTKqYVU3;T#{X{7YC7j4%0yhZv?sJO)X+t$utA4vkfK~3l-1yRKiZCG71D8 zZnbX420twV9Z!8O4hXDl`hs#(OOa zSI^afJk_!jN?aG~3@iCe{{3^kiVK50Z9F<&*19Yd_n12kJk@jN=qzUxuG`06;?@OULElK?7}F18u$iT3QBLT91b5|9wD2)S1wr#Q%A~XkNG@XhCMff^$?*Y`ovu mKp;LoUNbZ@>|B6fbf9L`+2DIWjAS>S*EW_XENabsGyel_N`D;y literal 0 HcmV?d00001 diff --git a/js/_hotkeyListener.js b/js/_hotkeyListener.js index 5ef277f..1142508 100644 --- a/js/_hotkeyListener.js +++ b/js/_hotkeyListener.js @@ -25,8 +25,8 @@ function KeyPress(e) { case 51: case 69: changeTool('eyedropper'); break; - //pan - 4, p, m - case 52: case 80: case 77: + //pan - 4, p, + case 52: case 80: changeTool('pan'); break; //zoom - 5 @@ -34,10 +34,14 @@ function KeyPress(e) { changeTool('zoom'); break; // eraser -6, r - case 54: case 82: + case 54: case 82: console.log("Pressed r"); changeTool('eraser'); break; + // Rectangular selection + case 77: case 109: + changeTool('rectselect'); + break; //Z case 90: console.log('PRESSED Z ', keyboardEvent.ctrlKey) diff --git a/js/_toolButtons.js b/js/_toolButtons.js index b96c953..3c48cbb 100644 --- a/js/_toolButtons.js +++ b/js/_toolButtons.js @@ -69,4 +69,9 @@ on('click',"zoom-out-button", function(){ for (let i=1; i + @@ -34,7 +36,9 @@ + +