From 099993415f2a6b3a21902f7d42d33b532d882686 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Tue, 16 Sep 2025 22:05:29 +0200 Subject: [PATCH] Input cleanup --- base/sources/backends/android_system.c | 6 - base/sources/backends/ios_system.m | 3 - base/sources/backends/linux_system.c | 28 ---- base/sources/backends/macos_system.m | 8 - base/sources/backends/wasm_system.c | 4 - base/sources/backends/windows_system.c | 15 -- base/sources/iron.h | 8 +- base/sources/iron_system.c | 34 ++--- base/sources/iron_system.h | 2 - base/sources/ts/input.ts | 202 ++++++++++--------------- base/sources/ts/iron.ts | 1 - base/sources/ts/sys.ts | 5 - paint/sources/base.ts | 10 +- paint/sources/render_path_base.ts | 2 +- 14 files changed, 99 insertions(+), 229 deletions(-) diff --git a/base/sources/backends/android_system.c b/base/sources/backends/android_system.c index d087cc98..1a76b675 100644 --- a/base/sources/backends/android_system.c +++ b/base/sources/backends/android_system.c @@ -1050,15 +1050,9 @@ bool iron_mouse_can_lock(void) { } void iron_mouse_show() {} - void iron_mouse_hide() {} - void iron_mouse_set_position(int x, int y) {} -void iron_internal_mouse_lock() {} - -void iron_internal_mouse_unlock(void) {} - void iron_mouse_get_position(int *x, int *y) { x = 0; y = 0; diff --git a/base/sources/backends/ios_system.m b/base/sources/backends/ios_system.m index 82502001..02c55f60 100644 --- a/base/sources/backends/ios_system.m +++ b/base/sources/backends/ios_system.m @@ -99,9 +99,6 @@ int iron_primary_display(void) { return 0; } -void iron_internal_mouse_lock(void) {} -void iron_internal_mouse_unlock(void) {} - bool iron_mouse_can_lock(void) { return false; } diff --git a/base/sources/backends/linux_system.c b/base/sources/backends/linux_system.c index 55ae1663..cc8df42f 100644 --- a/base/sources/backends/linux_system.c +++ b/base/sources/backends/linux_system.c @@ -1056,34 +1056,6 @@ int iron_hardware_threads(void) { return sysconf(_SC_NPROCESSORS_ONLN); } -void iron_internal_mouse_lock() { - iron_mouse_hide(); - int width = iron_window_width(); - int height = iron_window_height(); - - int x, y; - iron_mouse_get_position(&x, &y); - int newX = x; - int newY = y; - if (x < 0) { - newX -= x; - } - else if (x > width) { - newX -= x - width; - } - if (y < 0) { - newY -= y; - } - else if (y > height) { - newY -= y - height; - } - iron_mouse_set_position(newX, newY); -} - -void iron_internal_mouse_unlock() { - iron_mouse_show(); -} - bool iron_mouse_can_lock(void) { return true; } diff --git a/base/sources/backends/macos_system.m b/base/sources/backends/macos_system.m index 7c614efc..b98c3d4f 100644 --- a/base/sources/backends/macos_system.m +++ b/base/sources/backends/macos_system.m @@ -500,14 +500,6 @@ iron_display_mode_t iron_display_current_mode(int display) { return dm; } -void iron_internal_mouse_lock() { - iron_mouse_hide(); -} - -void iron_internal_mouse_unlock(void) { - iron_mouse_show(); -} - bool iron_mouse_can_lock(void) { return true; } diff --git a/base/sources/backends/wasm_system.c b/base/sources/backends/wasm_system.c index ef474d33..6cf02010 100644 --- a/base/sources/backends/wasm_system.c +++ b/base/sources/backends/wasm_system.c @@ -28,10 +28,6 @@ iron_display_mode_t iron_display_current_mode(int display_index) { return mode; } -void iron_internal_mouse_lock() {} - -void iron_internal_mouse_unlock(void) {} - bool iron_mouse_can_lock(void) { return false; } diff --git a/base/sources/backends/windows_system.c b/base/sources/backends/windows_system.c index fb9a8991..370172b1 100644 --- a/base/sources/backends/windows_system.c +++ b/base/sources/backends/windows_system.c @@ -190,21 +190,6 @@ iron_display_mode_t iron_display_current_mode(int display_index) { return mode; } -void iron_internal_mouse_lock() { - iron_mouse_hide(); - HWND handle = iron_windows_window_handle(); - SetCapture(handle); - RECT rect; - GetWindowRect(handle, &rect); - ClipCursor(&rect); -} - -void iron_internal_mouse_unlock(void) { - iron_mouse_show(); - ReleaseCapture(); - ClipCursor(NULL); -} - bool iron_mouse_can_lock(void) { return true; } diff --git a/base/sources/iron.h b/base/sources/iron.h index a71e4469..d0e09a53 100644 --- a/base/sources/iron.h +++ b/base/sources/iron.h @@ -210,7 +210,6 @@ void (*iron_shutdown)(void); void (*iron_pause)(void); void (*iron_key_down)(int); void (*iron_key_up)(int); -void (*iron_key_press)(int); void (*iron_mouse_down)(int, int, int); void (*iron_mouse_up)(int, int, int); void (*iron_mouse_move)(int, int, int, int); @@ -474,7 +473,6 @@ void _key_up(int code, void *data) { } void _key_press(unsigned int character, void *data) { - iron_key_press(character); if (ui_get_current()) ui_key_press(ui_get_current(), character); #ifdef IDLE_SLEEP @@ -747,6 +745,7 @@ void _iron_init(iron_window_options_t *ops) { iron_set_cut_callback(_cut, NULL); iron_set_copy_callback(_copy, NULL); iron_set_paste_callback(_paste, NULL); + iron_keyboard_set_key_press_callback(_key_press, NULL); #ifdef IRON_WINDOWS // Maximized window has x < -1, prevent window centering @@ -798,11 +797,6 @@ void iron_set_keyboard_up_callback(void (*callback)(int)) { iron_keyboard_set_key_up_callback(_key_up, NULL); } -void iron_set_keyboard_press_callback(void (*callback)(int)) { - iron_key_press = callback; - iron_keyboard_set_key_press_callback(_key_press, NULL); -} - void iron_set_mouse_down_callback(void (*callback)(int, int, int)) { iron_mouse_down = callback; iron_mouse_set_press_callback(_mouse_down, NULL); diff --git a/base/sources/iron_system.c b/base/sources/iron_system.c index ac921aa2..18d1a6dc 100644 --- a/base/sources/iron_system.c +++ b/base/sources/iron_system.c @@ -386,22 +386,19 @@ void iron_internal_mouse_trigger_scroll(int delta) { void iron_internal_mouse_window_activated() { if (iron_mouse_is_locked()) { - iron_internal_mouse_lock(); + iron_mouse_hide(); } } void iron_internal_mouse_window_deactivated() { if (iron_mouse_is_locked()) { - iron_internal_mouse_unlock(); + iron_mouse_show(); } } static bool moved = false; static bool locked = false; -static int preLockWindow = 0; static int preLockX = 0; static int preLockY = 0; -static int centerX = 0; -static int centerY = 0; static int lastX = 0; static int lastY = 0; @@ -417,12 +414,12 @@ void iron_internal_mouse_trigger_move(int x, int y) { int movementX = 0; int movementY = 0; if (iron_mouse_is_locked()) { - movementX = x - centerX; - movementY = y - centerY; + movementX = x - preLockX; + movementY = y - preLockY; if (movementX != 0 || movementY != 0) { - iron_mouse_set_position(centerX, centerY); - x = centerX; - y = centerY; + iron_mouse_set_position(preLockX, preLockY); + x = preLockX; + y = preLockY; } } else if (moved) { @@ -443,31 +440,22 @@ bool iron_mouse_is_locked(void) { } void iron_mouse_lock() { - if (iron_mouse_is_locked()) { - return; - } - if (!iron_mouse_can_lock()) { + if (iron_mouse_is_locked() || !iron_mouse_can_lock()) { return; } locked = true; - iron_internal_mouse_lock(); iron_mouse_get_position(&preLockX, &preLockY); - centerX = iron_window_width() / 2; - centerY = iron_window_height() / 2; - iron_mouse_set_position(centerX, centerY); + iron_mouse_hide(); } void iron_mouse_unlock(void) { - if (!iron_mouse_is_locked()) { - return; - } - if (!iron_mouse_can_lock()) { + if (!iron_mouse_is_locked() || !iron_mouse_can_lock()) { return; } moved = false; locked = false; - iron_internal_mouse_unlock(); iron_mouse_set_position(preLockX, preLockY); + iron_mouse_show(); } static void (*pen_press_callback)(int /*x*/, int /*y*/, float /*pressure*/) = NULL; diff --git a/base/sources/iron_system.h b/base/sources/iron_system.h index c80e44fe..2bcb84a7 100644 --- a/base/sources/iron_system.h +++ b/base/sources/iron_system.h @@ -334,8 +334,6 @@ void iron_internal_mouse_trigger_press(int button, int x, int y); void iron_internal_mouse_trigger_release(int button, int x, int y); void iron_internal_mouse_trigger_move(int x, int y); void iron_internal_mouse_trigger_scroll(int delta); -void iron_internal_mouse_lock(); -void iron_internal_mouse_unlock(void); void iron_internal_mouse_window_activated(); void iron_internal_mouse_window_deactivated(); void iron_pen_set_press_callback(void (*value)(int /*x*/, int /*y*/, float /*pressure*/)); diff --git a/base/sources/ts/input.ts b/base/sources/ts/input.ts index fd99780f..248b5cfa 100644 --- a/base/sources/ts/input.ts +++ b/base/sources/ts/input.ts @@ -41,15 +41,12 @@ let _mouse_buttons: string[] = ["left", "right", "middle", "side1", "side2"]; let _mouse_buttons_down: bool[] = [false, false, false, false, false]; let _mouse_buttons_started: bool[] = [false, false, false, false, false]; let _mouse_buttons_released: bool[] = [false, false, false, false, false]; - let mouse_x: f32 = 0.0; let mouse_y: f32 = 0.0; let mouse_moved: bool = false; let mouse_movement_x: f32 = 0.0; let mouse_movement_y: f32 = 0.0; let mouse_wheel_delta: f32 = 0.0; -let mouse_locked: bool = false; -let mouse_hidden: bool = false; let mouse_last_x: f32 = -1.0; let mouse_last_y: f32 = -1.0; @@ -96,32 +93,6 @@ function mouse_released(button: string = "left"): bool { return _mouse_buttons_released[mouse_button_index(button)]; } -function mouse_lock() { - if (iron_mouse_can_lock()) { - iron_mouse_lock(); - mouse_locked = true; - mouse_hidden = true; - } -} - -function mouse_unlock() { - if (iron_mouse_can_lock()) { - iron_mouse_unlock(); - mouse_locked = false; - mouse_hidden = false; - } -} - -function mouse_hide() { - iron_mouse_hide(); - mouse_hidden = true; -} - -function mouse_show() { - iron_mouse_show(); - mouse_hidden = false; -} - function mouse_down_listener(index: i32, x: i32, y: i32) { if (pen_in_use) { return; @@ -155,7 +126,7 @@ function mouse_move_listener(x: i32, y: i32, movement_x: i32, movement_y: i32) { mouse_last_x = x; mouse_last_y = y; } - if (mouse_locked) { + if (iron_mouse_is_locked()) { // Can be called multiple times per frame mouse_movement_x += movement_x; mouse_movement_y += movement_y; @@ -234,7 +205,6 @@ let pen_buttons: string[] = ["tip"]; let pen_buttons_down: bool[] = [false]; let pen_buttons_started: bool[] = [false]; let pen_buttons_released: bool[] = [false]; - let pen_x: f32 = 0.0; let pen_y: f32 = 0.0; let pen_moved: bool = false; @@ -405,257 +375,255 @@ function keyboard_key_code(key: key_code_t): string { if (key == key_code_t.SPACE) { return "space"; } - else if (key == key_code_t.BACKSPACE) { + if (key == key_code_t.BACKSPACE) { return "backspace"; } - else if (key == key_code_t.TAB) { + if (key == key_code_t.TAB) { return "tab"; } - else if (key == key_code_t.RETURN) { + if (key == key_code_t.RETURN) { return "enter"; } - else if (key == key_code_t.SHIFT) { + if (key == key_code_t.SHIFT) { return "shift"; } - else if (key == key_code_t.CONTROL) { + if (key == key_code_t.CONTROL) { return "control"; } ///if arm_macos - else if (key == key_code_t.META) { + if (key == key_code_t.META) { return "control"; } ///end - else if (key == key_code_t.ALT) { + if (key == key_code_t.ALT) { return "alt"; } - else if (key == key_code_t.WIN) { + if (key == key_code_t.WIN) { return "win"; } - else if (key == key_code_t.ESCAPE) { + if (key == key_code_t.ESCAPE) { return "escape"; } - else if (key == key_code_t.DELETE) { + if (key == key_code_t.DELETE) { return "delete"; } - else if (key == key_code_t.UP) { + if (key == key_code_t.UP) { return "up"; } - else if (key == key_code_t.DOWN) { + if (key == key_code_t.DOWN) { return "down"; } - else if (key == key_code_t.LEFT) { + if (key == key_code_t.LEFT) { return "left"; } - else if (key == key_code_t.RIGHT) { + if (key == key_code_t.RIGHT) { return "right"; } - else if (key == key_code_t.BACK) { + if (key == key_code_t.BACK) { return "back"; } - else if (key == key_code_t.COMMA) { + if (key == key_code_t.COMMA) { return ","; } - else if (key == key_code_t.PERIOD) { + if (key == key_code_t.PERIOD) { return "."; } - else if (key == key_code_t.COLON) { + if (key == key_code_t.COLON) { return ":"; } - else if (key == key_code_t.SEMICOLON) { + if (key == key_code_t.SEMICOLON) { return ";"; } - else if (key == key_code_t.LESS_THAN) { + if (key == key_code_t.LESS_THAN) { return "<"; } - else if (key == key_code_t.EQUALS) { + if (key == key_code_t.EQUALS) { return "="; } - else if (key == key_code_t.GREATER_THAN) { + if (key == key_code_t.GREATER_THAN) { return ">"; } - else if (key == key_code_t.QUESTION_MARK) { + if (key == key_code_t.QUESTION_MARK) { return "?"; } - else if (key == key_code_t.EXCLAMATION) { + if (key == key_code_t.EXCLAMATION) { return "!"; } - else if (key == key_code_t.DOUBLE_QUOTE) { + if (key == key_code_t.DOUBLE_QUOTE) { return "\""; } - else if (key == key_code_t.HASH) { + if (key == key_code_t.HASH) { return "#"; } - else if (key == key_code_t.DOLLAR) { + if (key == key_code_t.DOLLAR) { return "$"; } - else if (key == key_code_t.PERCENT) { + if (key == key_code_t.PERCENT) { return "%"; } - else if (key == key_code_t.AMPERSAND) { + if (key == key_code_t.AMPERSAND) { return "&"; } - else if (key == key_code_t.UNDERSCORE) { + if (key == key_code_t.UNDERSCORE) { return "_"; } - else if (key == key_code_t.OPEN_PAREN) { + if (key == key_code_t.OPEN_PAREN) { return "("; } - else if (key == key_code_t.CLOSE_PAREN) { + if (key == key_code_t.CLOSE_PAREN) { return ")"; } - else if (key == key_code_t.ASTERISK) { + if (key == key_code_t.ASTERISK) { return "*"; } - else if (key == key_code_t.PIPE) { + if (key == key_code_t.PIPE) { return "|"; } - else if (key == key_code_t.OPEN_CURLY_BRACKET) { + if (key == key_code_t.OPEN_CURLY_BRACKET) { return "{"; } - else if (key == key_code_t.CLOSE_CURLY_BRACKET) { + if (key == key_code_t.CLOSE_CURLY_BRACKET) { return "}"; } - else if (key == key_code_t.OPEN_BRACKET) { + if (key == key_code_t.OPEN_BRACKET) { return "["; } - else if (key == key_code_t.CLOSE_BRACKET) { + if (key == key_code_t.CLOSE_BRACKET) { return "]"; } - else if (key == key_code_t.TILDE) { + if (key == key_code_t.TILDE) { return "~"; } - else if (key == key_code_t.BACK_QUOTE) { + if (key == key_code_t.BACK_QUOTE) { return "`"; } - else if (key == key_code_t.SLASH) { + if (key == key_code_t.SLASH) { return "/"; } - else if (key == key_code_t.BACK_SLASH) { + if (key == key_code_t.BACK_SLASH) { return "\\"; } - else if (key == key_code_t.AT) { + if (key == key_code_t.AT) { return "@"; } - else if (key == key_code_t.ADD) { + if (key == key_code_t.ADD) { return "+"; } - else if (key == key_code_t.PLUS) { + if (key == key_code_t.PLUS) { return "+"; } - else if (key == key_code_t.SUBTRACT) { + if (key == key_code_t.SUBTRACT) { return "-"; } - else if (key == key_code_t.HYPHEN_MINUS) { + if (key == key_code_t.HYPHEN_MINUS) { return "-"; } - else if (key == key_code_t.MULTIPLY) { + if (key == key_code_t.MULTIPLY) { return "*"; } - else if (key == key_code_t.DIVIDE) { + if (key == key_code_t.DIVIDE) { return "/"; } - else if (key == key_code_t.DECIMAL) { + if (key == key_code_t.DECIMAL) { return "."; } - else if (key == key_code_t.ZERO) { + if (key == key_code_t.ZERO) { return "0"; } - else if (key == key_code_t.NUMPAD0) { + if (key == key_code_t.NUMPAD0) { return "0"; } - else if (key == key_code_t.ONE) { + if (key == key_code_t.ONE) { return "1"; } - else if (key == key_code_t.NUMPAD1) { + if (key == key_code_t.NUMPAD1) { return "1"; } - else if (key == key_code_t.TWO) { + if (key == key_code_t.TWO) { return "2"; } - else if (key == key_code_t.NUMPAD2) { + if (key == key_code_t.NUMPAD2) { return "2"; } - else if (key == key_code_t.THREE) { + if (key == key_code_t.THREE) { return "3"; } - else if (key == key_code_t.NUMPAD3) { + if (key == key_code_t.NUMPAD3) { return "3"; } - else if (key == key_code_t.FOUR) { + if (key == key_code_t.FOUR) { return "4"; } - else if (key == key_code_t.NUMPAD4) { + if (key == key_code_t.NUMPAD4) { return "4"; } - else if (key == key_code_t.FIVE) { + if (key == key_code_t.FIVE) { return "5"; } - else if (key == key_code_t.NUMPAD5) { + if (key == key_code_t.NUMPAD5) { return "5"; } - else if (key == key_code_t.SIX) { + if (key == key_code_t.SIX) { return "6"; } - else if (key == key_code_t.NUMPAD6) { + if (key == key_code_t.NUMPAD6) { return "6"; } - else if (key == key_code_t.SEVEN) { + if (key == key_code_t.SEVEN) { return "7"; } - else if (key == key_code_t.NUMPAD7) { + if (key == key_code_t.NUMPAD7) { return "7"; } - else if (key == key_code_t.EIGHT) { + if (key == key_code_t.EIGHT) { return "8"; } - else if (key == key_code_t.NUMPAD8) { + if (key == key_code_t.NUMPAD8) { return "8"; } - else if (key == key_code_t.NINE) { + if (key == key_code_t.NINE) { return "9"; } - else if (key == key_code_t.NUMPAD9) { + if (key == key_code_t.NUMPAD9) { return "9"; } - else if (key == key_code_t.F1) { + if (key == key_code_t.F1) { return "f1"; } - else if (key == key_code_t.F2) { + if (key == key_code_t.F2) { return "f2"; } - else if (key == key_code_t.F3) { + if (key == key_code_t.F3) { return "f3"; } - else if (key == key_code_t.F4) { + if (key == key_code_t.F4) { return "f4"; } - else if (key == key_code_t.F5) { + if (key == key_code_t.F5) { return "f5"; } - else if (key == key_code_t.F6) { + if (key == key_code_t.F6) { return "f6"; } - else if (key == key_code_t.F7) { + if (key == key_code_t.F7) { return "f7"; } - else if (key == key_code_t.F8) { + if (key == key_code_t.F8) { return "f8"; } - else if (key == key_code_t.F9) { + if (key == key_code_t.F9) { return "f9"; } - else if (key == key_code_t.F10) { + if (key == key_code_t.F10) { return "f10"; } - else if (key == key_code_t.F11) { + if (key == key_code_t.F11) { return "f11"; } - else if (key == key_code_t.F12) { + if (key == key_code_t.F12) { return "f12"; } - else { - return to_lower_case(string_from_char_code(key)); - } + return to_lower_case(string_from_char_code(key)); } function keyboard_down_listener(code: key_code_t) { @@ -687,8 +655,6 @@ function keyboard_up_listener(code: key_code_t) { ///end } -function keyboard_press_listener(c: string) {} - ///if WITH_GAMEPAD let gamepad_buttons_ps: string[] = ["cross", "circle", "square", "triangle", "l1", "r1", "l2", "r2", "share", "options", "l3", "r3", "up", "down", "left", "right", "home", "touchpad"]; diff --git a/base/sources/ts/iron.ts b/base/sources/ts/iron.ts index 1610d46a..6dcf9ac5 100644 --- a/base/sources/ts/iron.ts +++ b/base/sources/ts/iron.ts @@ -189,7 +189,6 @@ declare function _iron_set_drop_files_callback(callback: (file: string)=>void): declare function iron_set_application_state_callback(on_foreground: ()=>void, on_resume: ()=>void, on_pause: ()=>void, on_background: ()=>void, on_shutdown: ()=>void): void; declare function iron_set_keyboard_down_callback(callback: (code: i32)=>void): void; declare function iron_set_keyboard_up_callback(callback: (code: i32)=>void): void; -declare function iron_set_keyboard_press_callback(callback: (char_code: i32)=>void): void; declare function iron_set_mouse_down_callback(callback: (button: i32, x: i32, y: i32)=>void): void; declare function iron_set_mouse_up_callback(callback: (button: i32, x: i32, y: i32)=>void): void; declare function iron_set_mouse_move_callback(callback: (x: i32, y: i32, mx: i32, my: i32)=>void): void; diff --git a/base/sources/ts/sys.ts b/base/sources/ts/sys.ts index bb5bf7de..c6eeef44 100644 --- a/base/sources/ts/sys.ts +++ b/base/sources/ts/sys.ts @@ -60,7 +60,6 @@ function sys_start(ops: iron_window_options_t) { iron_set_application_state_callback(sys_foreground_callback, sys_resume_callback, sys_pause_callback, sys_background_callback, sys_shutdown_callback); iron_set_keyboard_down_callback(sys_keyboard_down_callback); iron_set_keyboard_up_callback(sys_keyboard_up_callback); - iron_set_keyboard_press_callback(sys_keyboard_press_callback); iron_set_mouse_down_callback(sys_mouse_down_callback); iron_set_mouse_up_callback(sys_mouse_up_callback); iron_set_mouse_move_callback(sys_mouse_move_callback); @@ -181,10 +180,6 @@ function sys_keyboard_up_callback(code: i32) { keyboard_up_listener(code); } -function sys_keyboard_press_callback(char_code: i32) { - keyboard_press_listener(string_from_char_code(char_code)); -} - function sys_mouse_down_callback(button: i32, x: i32, y: i32) { mouse_down_listener(button, x, y); } diff --git a/paint/sources/base.ts b/paint/sources/base.ts index 2090a8e5..c756d89b 100644 --- a/paint/sources/base.ts +++ b/paint/sources/base.ts @@ -1083,7 +1083,7 @@ function ui_base_update() { (decal_mask && operator_shortcut(map_get(config_keymap, "decal_mask") + "+" + map_get(config_keymap, "brush_radius")))) { context_raw.brush_can_lock = true; if (!pen_connected) { - mouse_lock(); + iron_mouse_lock(); } context_raw.lock_started_x = mouse_x; context_raw.lock_started_y = mouse_y; @@ -1234,7 +1234,7 @@ function ui_base_update() { !(decal_mask && operator_shortcut(map_get(config_keymap, "decal_mask") + "+" + map_get(config_keymap, "brush_radius"), shortcut_type_t.DOWN)); if (b) { - mouse_unlock(); + iron_mouse_unlock(); context_raw.last_paint_x = -1; context_raw.last_paint_y = -1; if (context_raw.brush_can_lock) { @@ -1783,12 +1783,6 @@ function ui_base_render_cursor() { let my: i32 = base_y() + context_raw.paint_vec.y * base_h(); context_raw.view_index = -1; - // Radius being scaled - if (context_raw.brush_locked) { - mx += context_raw.lock_started_x - iron_window_width() / 2; - my += context_raw.lock_started_y - iron_window_height() / 2; - } - if (context_raw.brush_stencil_image != null && context_raw.tool != tool_type_t.BAKE && context_raw.tool != tool_type_t.PICKER && diff --git a/paint/sources/render_path_base.ts b/paint/sources/render_path_base.ts index 66ddc288..ad9a00cd 100644 --- a/paint/sources/render_path_base.ts +++ b/paint/sources/render_path_base.ts @@ -105,7 +105,7 @@ function render_path_base_is_cached(): bool { render_path_base_last_y = mouse_view_y(); if (context_raw.ddirty <= 0 && context_raw.rdirty <= 0 && context_raw.pdirty <= 0) { - if (mx != render_path_base_last_x || my != render_path_base_last_y || mouse_locked) { + if (mx != render_path_base_last_x || my != render_path_base_last_y || iron_mouse_is_locked()) { context_raw.ddirty = 0; }