From d47e33acb06b65e87f3cc7eb6d3b8ffd86c9201e Mon Sep 17 00:00:00 2001 From: Alec Murphy Date: Mon, 19 May 2025 13:14:37 -0400 Subject: [PATCH] Applications/Internet/Cyberia: Handle all vscroll changes before issuing reflow in @cyberia_win_repaint() callback --- Applications/Internet/Cyberia.app/Cyberia.HC | 23 ++++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Applications/Internet/Cyberia.app/Cyberia.HC b/Applications/Internet/Cyberia.app/Cyberia.HC index 4b727a1..b9be25b 100644 --- a/Applications/Internet/Cyberia.app/Cyberia.HC +++ b/Applications/Internet/Cyberia.app/Cyberia.HC @@ -22,9 +22,9 @@ TextInputWidget* addressbar1 = NULL; @window_widgets_list* widgets_base = NULL; @html_dom_node* node_list = NULL; -I64 old_window_width = -1; -I64 old_window_height = -1; -I64 old_mouse_z = Mouse.z; +I64 prev_win_width = -1; +I64 prev_win_height = -1; +I64 prev_mouse_z = Mouse.z; Window* hanbaga_menu = Menu.New("Cyberia"); Menu.AddItem(hanbaga_menu, "New Tab", NULL, &Reboot, NULL, NULL); @@ -809,12 +809,11 @@ U0 @cyberia_win_repaint(Window*) vscroll1->width = 16; vscroll1->height = background1->height; - I64 delta_z = Mouse.z - old_mouse_z; + I64 delta_z = Mouse.z - prev_mouse_z; if (delta_z) { vscroll1->scroll += (RENDERER_DEFAULT_MAX_LINE_HEIGHT * delta_z); - @cyberia_vscroll_change(vscroll1); } - old_mouse_z = Mouse.z; + prev_mouse_z = Mouse.z; if (StrLen(&status2->text)) { status1->y = win->height; @@ -829,18 +828,18 @@ U0 @cyberia_win_repaint(Window*) if (!browser || !browser->renderer || !widgets_base) return; - if (widgets_base->next && (old_window_width != win->width || old_window_height != win->height)) { - @reflow_node_list(browser->renderer); - old_window_width = win->width; - old_window_height = win->height; - } - if (browser->renderer->calculated_page_height > background1->height) { vscroll1->max = browser->renderer->calculated_page_height; vscroll1->length = (vscroll1->height - 31) / MaxI64(2, ToI64(browser->renderer->calculated_page_height / background1->height)); vscroll1->x = win->width - 25; background1->width -= vscroll1->width; } + + if (widgets_base->next && (prev_win_width != win->width || prev_win_height != win->height) || delta_z) { + @reflow_node_list(browser->renderer); + prev_win_width = win->width; + prev_win_height = win->height; + } } U0 @cyberia_unset_status_text()