mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-30 20:24:08 +00:00
markdown: Fix code block scrollbars flashing on vertical scroll (#50817)
Release Notes: - Fixed code block scrollbars flashing on vertical scroll before: When there are many code blocks, scrolling through markdown will display a horizontal scrollbar (when the mouse is not inside a code block). https://github.com/user-attachments/assets/1fae36ec-5a3f-4283-b54f-e5cb4f45646b after: When scrolling markdown, do not display the horizontal scrollbar when the mouse is not in a code block. https://github.com/user-attachments/assets/0c0f2016-9b18-4055-87a6-4f508dbfd193 --------- Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
This commit is contained in:
parent
a99366a940
commit
7a4aaff8ea
1 changed files with 12 additions and 1 deletions
|
|
@ -1041,7 +1041,18 @@ impl ScrollbarLayout {
|
|||
|
||||
impl PartialEq for ScrollbarLayout {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.axis == other.axis && self.thumb_bounds == other.thumb_bounds
|
||||
if self.axis != other.axis {
|
||||
return false;
|
||||
}
|
||||
|
||||
let axis = self.axis;
|
||||
let thumb_offset =
|
||||
self.thumb_bounds.origin.along(axis) - self.track_bounds.origin.along(axis);
|
||||
let other_thumb_offset =
|
||||
other.thumb_bounds.origin.along(axis) - other.track_bounds.origin.along(axis);
|
||||
|
||||
thumb_offset == other_thumb_offset
|
||||
&& self.thumb_bounds.size.along(axis) == other.thumb_bounds.size.along(axis)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue