Introduce a short-term solution for flickering (#8542)
This uses bounds checking alone to determine hover state to avoid flicker. It's a short-term solution because the rendering is incorrect. We think this is better than flickering though and buys us some time as we work on a more robust solution overall. Release Notes: - Fixed flickering when hovering. --------- Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan
parent
517ea734ee
commit
7aba9eb4b7
@@ -923,9 +923,15 @@ impl EditorElement {
|
||||
.as_ref()
|
||||
.is_some_and(|hovered_link_state| !hovered_link_state.links.is_empty())
|
||||
{
|
||||
cx.set_cursor_style(CursorStyle::PointingHand);
|
||||
cx.set_cursor_style(
|
||||
CursorStyle::PointingHand,
|
||||
interactive_text_bounds.stacking_order.clone(),
|
||||
);
|
||||
} else {
|
||||
cx.set_cursor_style(CursorStyle::IBeam);
|
||||
cx.set_cursor_style(
|
||||
CursorStyle::IBeam,
|
||||
interactive_text_bounds.stacking_order.clone(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1552,7 +1558,10 @@ impl EditorElement {
|
||||
};
|
||||
let mut mouse_position = cx.mouse_position();
|
||||
if interactive_track_bounds.visibly_contains(&mouse_position, cx) {
|
||||
cx.set_cursor_style(CursorStyle::Arrow);
|
||||
cx.set_cursor_style(
|
||||
CursorStyle::Arrow,
|
||||
interactive_track_bounds.stacking_order.clone(),
|
||||
);
|
||||
}
|
||||
|
||||
cx.on_mouse_event({
|
||||
|
||||
Reference in New Issue
Block a user