Skip to content
Snippets Groups Projects
Commit 7dd9d919 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Remove hot-spots as soon as they scroll off the screen.

Don't keep them around until there's no hotspots left.
parent 884fa9d0
Branches
No related tags found
No related merge requests found
Pipeline #8839 passed
...@@ -24,10 +24,19 @@ void Terminal::scroll_hotspots(unsigned count) ...@@ -24,10 +24,19 @@ void Terminal::scroll_hotspots(unsigned count)
return; return;
unsigned spots = 0; unsigned spots = 0;
unsigned remain = 0; unsigned remain = 0;
for (list_node_t* node = mouse_hotspots->first; node != NULL; node = node->next) { list_node_t* node = mouse_hotspots->first;
while (node != NULL) {
struct mouse_hotspot* spot = (struct mouse_hotspot*)node->data; struct mouse_hotspot* spot = (struct mouse_hotspot*)node->data;
spot->y -= count; list_node_t* next = node->next;
if (spot->y >= count) {
spot->y -= count;
remain++;
}
else {
listRemoveNode(mouse_hotspots, node, true);
}
spots++; spots++;
node = next;
} }
#ifdef _DEBUG #ifdef _DEBUG
if (spots) if (spots)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment