Skip to content

Commit 16ae713

Browse files
committed
Cleanup
1 parent d418fd7 commit 16ae713

3 files changed

Lines changed: 16 additions & 24 deletions

File tree

paint/sources/base.ts

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -313,25 +313,6 @@ function base_resize() {
313313
base_redraw_ui();
314314
}
315315

316-
function base_redraw_ui() {
317-
ui_header_handle.redraws = 2;
318-
ui_base_hwnds[tab_area_t.STATUS].redraws = 2;
319-
ui_menubar_menu_handle.redraws = 2;
320-
ui_nodes_hwnd.redraws = 2;
321-
ui_box_hwnd.redraws = 2;
322-
ui_view2d_hwnd.redraws = 2;
323-
// Redraw viewport
324-
if (context_raw.ddirty < 0) {
325-
context_raw.ddirty = 0;
326-
}
327-
ui_base_hwnds[tab_area_t.SIDEBAR0].redraws = 2;
328-
ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2;
329-
ui_toolbar_handle.redraws = 2;
330-
if (context_raw.split_view) {
331-
context_raw.ddirty = 1;
332-
}
333-
}
334-
335316
function base_update() {
336317
if (mouse_movement_x != 0 || mouse_movement_y != 0) {
337318
iron_mouse_set_cursor(cursor_t.ARROW);
@@ -2074,13 +2055,24 @@ function ui_base_on_tab_drop(to: ui_handle_t, to_position: i32, from: ui_handle_
20742055
}
20752056
}
20762057

2077-
function ui_base_tag_ui_redraw() {
2058+
function base_redraw_ui() {
20782059
ui_header_handle.redraws = 2;
20792060
ui_base_hwnds[tab_area_t.STATUS].redraws = 2;
20802061
ui_menubar_menu_handle.redraws = 2;
2062+
ui_menubar_hwnd.redraws = 2;
2063+
ui_nodes_hwnd.redraws = 2;
2064+
ui_box_hwnd.redraws = 2;
2065+
ui_view2d_hwnd.redraws = 2;
2066+
// Redraw viewport
2067+
if (context_raw.ddirty < 0) {
2068+
context_raw.ddirty = 0;
2069+
}
20812070
ui_base_hwnds[tab_area_t.SIDEBAR0].redraws = 2;
20822071
ui_base_hwnds[tab_area_t.SIDEBAR1].redraws = 2;
20832072
ui_toolbar_handle.redraws = 2;
2073+
if (context_raw.split_view) {
2074+
context_raw.ddirty = 1;
2075+
}
20842076
}
20852077

20862078
function ui_base_make_empty_envmap(col: i32) {

paint/sources/box_preferences.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function box_preferences_show() {
2727
let locale_code: string = box_preferences_locales[locale_handle.position];
2828
config_raw.locale = locale_code;
2929
translator_load_translations(locale_code);
30-
ui_base_tag_ui_redraw();
30+
base_redraw_ui();
3131
}
3232

3333
let hscale: ui_handle_t = ui_handle(__ID__);
@@ -101,7 +101,7 @@ function box_preferences_show() {
101101
}
102102
config_raw.show_asset_names = ui_check(h_show_asset_names, tr("Show Asset Names"));
103103
if (ui.changed) {
104-
ui_base_tag_ui_redraw();
104+
base_redraw_ui();
105105
}
106106

107107
///if !(arm_android || arm_ios)
@@ -117,7 +117,7 @@ function box_preferences_show() {
117117
ui_touch_tooltip = config_raw.touch_ui;
118118
config_load_theme(config_raw.theme);
119119
box_preferences_set_scale();
120-
ui_base_tag_ui_redraw();
120+
base_redraw_ui();
121121
}
122122
///end
123123

paint/sources/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ function config_load_theme(theme: string, tag_redraw: bool = true) {
385385

386386
if (tag_redraw) {
387387
ui.ops.theme = base_theme;
388-
ui_base_tag_ui_redraw();
388+
base_redraw_ui();
389389
}
390390

391391
if (config_raw.touch_ui) {

0 commit comments

Comments
 (0)