mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
@ -354,7 +354,7 @@ const ColorPicker = (() => {
|
||||
function movePickerIcon(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (event.which == 1 || draggingCursor) {
|
||||
if (event.buttons == 1 || draggingCursor) {
|
||||
let cursorPos = getCursorPosMinipicker(event);
|
||||
let canvasRect = miniPickerCanvas.getBoundingClientRect();
|
||||
|
||||
@ -507,6 +507,10 @@ const ColorPicker = (() => {
|
||||
styles[1] += "background: linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(0,0,0,1) 0%, " +
|
||||
"rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",1) 100%);}";
|
||||
|
||||
styles[1] += "input[type=range]#cp-minipicker-slider::-moz-range-track { background: rgb(2,0,36);";
|
||||
styles[1] += "background: linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(0,0,0,1) 0%, " +
|
||||
"rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",1) 100%);}";
|
||||
|
||||
updateMiniPickerSpectrum();
|
||||
updateStyles();
|
||||
}
|
||||
|
@ -141,11 +141,11 @@ const PaletteBlock = (() => {
|
||||
* @param {*} mouseEvent
|
||||
*/
|
||||
function updateRampSelection(mouseEvent) {
|
||||
if (mouseEvent != null && mouseEvent.which == 3) {
|
||||
if (mouseEvent != null && mouseEvent.buttons == 2) {
|
||||
currentSelection.endIndex = getElementIndex(mouseEvent.target);
|
||||
}
|
||||
|
||||
if (mouseEvent == null || mouseEvent.which == 3) {
|
||||
if (mouseEvent == null || mouseEvent.buttons == 2) {
|
||||
let startCoords = getColourCoordinates(currentSelection.startIndex);
|
||||
let endCoords = getColourCoordinates(currentSelection.endIndex);
|
||||
|
||||
|
@ -24,7 +24,7 @@ const ToolManager = (() => {
|
||||
Events.on("mouseup", window, onMouseUp);
|
||||
Events.on("mousemove", window, onMouseMove);
|
||||
Events.on("mousedown", window, onMouseDown);
|
||||
Events.on("mousewheel", window, onMouseWheel);
|
||||
Events.on("wheel", window, onMouseWheel);
|
||||
|
||||
// Bind tool shortcuts
|
||||
Events.onCustom("tool-shortcut", onShortcut);
|
||||
@ -36,6 +36,7 @@ const ToolManager = (() => {
|
||||
}
|
||||
|
||||
function onMouseWheel(mouseEvent) {
|
||||
console.log("MOUSE WHEEL");
|
||||
if (!EditorState.documentCreated || Dialogue.isOpen())
|
||||
return;
|
||||
|
||||
@ -82,7 +83,7 @@ const ToolManager = (() => {
|
||||
currTool.onHover(mousePos, mouseEvent.target);
|
||||
|
||||
if (Input.isDragging()) {
|
||||
switch (mouseEvent.which) {
|
||||
switch (mouseEvent.buttons) {
|
||||
case 1:
|
||||
if (Input.isSpacePressed()) {
|
||||
tools["pan"].onDrag(mousePos, mouseEvent.target);
|
||||
@ -94,10 +95,10 @@ const ToolManager = (() => {
|
||||
currTool.onDrag(mousePos, mouseEvent.target);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
tools["pan"].onDrag(mousePos, mouseEvent.target);
|
||||
break;
|
||||
case 3:
|
||||
case 2:
|
||||
currTool.onRightDrag(mousePos, mouseEvent.target);
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user