core: only update mouse hover point when no other mouse action

This commit is contained in:
Mitchell Hashimoto
2023-11-29 14:49:36 -08:00
parent 8fcf3f08dd
commit dcbe0b8a5f

View File

@ -2069,8 +2069,10 @@ pub fn cursorPosCallback(
self.renderer_state.mutex.lock(); self.renderer_state.mutex.lock();
defer self.renderer_state.mutex.unlock(); defer self.renderer_state.mutex.unlock();
// Update our mouse state // Update our mouse state. We set this to null initially because we only
self.renderer_state.mouse.point = pos_vp; // want to set it when we're not selecting or doing any other mouse
// event.
self.renderer_state.mouse.point = null;
// If we have an inspector, we need to always record position information // If we have an inspector, we need to always record position information
if (self.inspector) |insp| { if (self.inspector) |insp| {
@ -2136,6 +2138,7 @@ pub fn cursorPosCallback(
// Handle link hovering // Handle link hovering
if (try self.linkAtPos(pos)) |_| { if (try self.linkAtPos(pos)) |_| {
self.renderer_state.mouse.point = pos_vp;
self.mouse.over_link = true; self.mouse.over_link = true;
try self.rt_surface.setMouseShape(.pointer); try self.rt_surface.setMouseShape(.pointer);
try self.queueRender(); try self.queueRender();