From da99e6da861a7aaf7ddaed0ee06e163d4d370c0a Mon Sep 17 00:00:00 2001 From: luboslenco Date: Mon, 22 Sep 2025 19:26:49 +0200 Subject: [PATCH] Cleanup --- paint/sources/base.ts | 8 -------- paint/sources/context.ts | 4 ---- paint/sources/render_path_paint.ts | 10 ++-------- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/paint/sources/base.ts b/paint/sources/base.ts index a572673a..aa1ff33b 100644 --- a/paint/sources/base.ts +++ b/paint/sources/base.ts @@ -1071,8 +1071,6 @@ function ui_base_update() { if (!pen_connected) { iron_mouse_lock(); } - context_raw.lock_started_x = mouse_x; - context_raw.lock_started_y = mouse_y; } else if (operator_shortcut(map_get(config_keymap, "brush_radius_decrease"), shortcut_type_t.REPEAT)) { context_raw.brush_radius -= ui_base_get_radius_increment(); @@ -1851,12 +1849,6 @@ function ui_base_render_cursor() { context_raw.decal_x = context_raw.paint_vec.x; context_raw.decal_y = context_raw.paint_vec.y; decal_alpha = context_raw.brush_opacity; - - // Radius being scaled - if (context_raw.brush_locked) { - context_raw.decal_x += (context_raw.lock_started_x - iron_window_width() / 2) / base_w(); - context_raw.decal_y += (context_raw.lock_started_y - iron_window_height() / 2) / base_h(); - } } if (!config_raw.brush_live) { diff --git a/paint/sources/context.ts b/paint/sources/context.ts index c3fa4f8d..b94072bb 100644 --- a/paint/sources/context.ts +++ b/paint/sources/context.ts @@ -75,8 +75,6 @@ type context_t = { frame?: i32; paint2d_view?: bool; - lock_started_x?: f32; - lock_started_y?: f32; brush_locked?: bool; brush_can_lock?: bool; brush_can_unlock?: bool; @@ -322,8 +320,6 @@ function context_create(): context_t { c.prev_paint_vec_y = -1.0; c.frame = 0; c.paint2d_view = false; - c.lock_started_x = -1.0; - c.lock_started_y = -1.0; c.brush_locked = false; c.brush_can_lock = false; c.brush_can_unlock = false; diff --git a/paint/sources/render_path_paint.ts b/paint/sources/render_path_paint.ts index 11519805..9dc784fc 100644 --- a/paint/sources/render_path_paint.ts +++ b/paint/sources/render_path_paint.ts @@ -372,10 +372,7 @@ function render_path_paint_commands_live_brush() { ui_view2d_hwnd.redraws = 2; let _x: f32 = context_raw.paint_vec.x; let _y: f32 = context_raw.paint_vec.y; - if (context_raw.brush_locked) { - context_raw.paint_vec.x = (context_raw.lock_started_x - sys_x()) / sys_w(); - context_raw.paint_vec.y = (context_raw.lock_started_y - sys_y()) / sys_h(); - } + let _last_x: f32 = context_raw.last_paint_vec_x; let _last_y: f32 = context_raw.last_paint_vec_y; let _pdirty: i32 = context_raw.pdirty; @@ -421,10 +418,7 @@ function render_path_paint_commands_cursor() { let mx: f32 = context_raw.paint_vec.x; let my: f32 = 1.0 - context_raw.paint_vec.y; - if (context_raw.brush_locked) { - mx = (context_raw.lock_started_x - sys_x()) / sys_w(); - my = 1.0 - (context_raw.lock_started_y - sys_y()) / sys_h(); - } + let radius: f32 = decal_mask ? context_raw.brush_decal_mask_radius : context_raw.brush_radius; render_path_paint_draw_cursor(mx, my, context_raw.brush_nodes_radius * radius / 3.4); }