Commit f42798ba authored by Ategon's avatar Ategon Committed by Grant
Browse files

Fix extra color pick on primary when selecting with secondary

parent 7e4d9063
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -555,7 +555,7 @@ const CanvasInner = () => {
    const zoomInSmall = () => zoomBy(KEYBOARD_ZOOM_SMALL_STEP);

    KeybindManager.on("PIXEL_WHOIS", handlePixelWhois);
    KeybindManager.on("PICK_COLOR", handlePickPixel);
    KeybindManager.on("PICK_CANVAS_COLOR", handlePickPixel);
    KeybindManager.on("CAPTURE_CANVAS", captureCanvas);
    KeybindManager.on("CAPTURE_VIEW", captureView);
    KeybindManager.on("CAPTURE_REGION", captureRegion);
@@ -567,7 +567,7 @@ const CanvasInner = () => {

    return () => {
      KeybindManager.off("PIXEL_WHOIS", handlePixelWhois);
      KeybindManager.off("PICK_COLOR", handlePickPixel);
      KeybindManager.off("PICK_CANVAS_COLOR", handlePickPixel);
      KeybindManager.off("CAPTURE_CANVAS", captureCanvas);
      KeybindManager.off("CAPTURE_VIEW", captureView);
      KeybindManager.off("CAPTURE_REGION", captureRegion);
+1 −9
Original line number Diff line number Diff line
@@ -466,15 +466,7 @@ export const Palette = () => {
      PaletteLib.swapSelectedColors();
    };

    const handlePickColorKeybind = ({
      clientX,
      clientY,
    }: {
      clientX: number;
      clientY: number;
    }) => {
      if (clientX >= 0 && clientY >= 0) return;

    const handlePickColorKeybind = () => {
      setPickColorPreview(null);
      setPickColorMode(true);
    };
+5 −3
Original line number Diff line number Diff line
@@ -175,9 +175,6 @@ const KEYBINDS = enforceObjectType({
    },
  ],
  PICK_COLOR: [
    {
      key: "MCLICK",
    },
    {
      key: "KeyC",
      ctrl: false,
@@ -186,6 +183,11 @@ const KEYBINDS = enforceObjectType({
      shift: false,
    },
  ],
  PICK_CANVAS_COLOR: [
    {
      key: "MCLICK",
    },
  ],
  MOD_SELECT: [
    {
      key: "LCLICK",