Skip to content

Commit 6d920fd

Browse files
fix custom mouse cursors
UI elements with custom mouse cursors wouldn't show them due to the cursor being reset at the start of each frame. To fix this we need to be sure that we only reset when the element is no longer active.
1 parent 14ee2b5 commit 6d920fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

code/ui/button.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ void UI_BUTTON::maybe_show_custom_cursor()
445445

446446
void UI_BUTTON::restore_previous_cursor()
447447
{
448-
if (previous_cursor != NULL) {
448+
if (previous_cursor != NULL && !is_mouse_on()) {
449449
io::mouse::CursorManager::get()->setCurrentCursor(previous_cursor);
450450
previous_cursor = NULL;
451451
}

0 commit comments

Comments
 (0)