Cleanup
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user