Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Prevent some cases of clipping icons due to pixel coord rounding

Julia332b364a30f1
diff --git a/crates/drag_and_drop/src/drag_and_drop.rs b/crates/drag_and_drop/src/drag_and_drop.rs
index fdf122593ee..828e7304038 100644
--- a/crates/drag_and_drop/src/drag_and_drop.rs
+++ b/crates/drag_and_drop/src/drag_and_drop.rs
@@ -199,7 +199,7 @@ impl<V: View> DragAndDrop<V> {
return None;
}
- let position = position - region_offset;
+ let position = (position - region_offset).round();
Some(
Overlay::new(
MouseEventHandler::<DraggedElementHandler, V>::new(
diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs
index d1ad1f26259..f2e8aca81db 100644
--- a/crates/editor/src/element.rs
+++ b/crates/editor/src/element.rs
@@ -1609,7 +1609,8 @@ impl Element<Editor> for EditorElement {
let gutter_width;
let gutter_margin;
if snapshot.mode == EditorMode::Full {
- gutter_padding = style.text.em_width(cx.font_cache()) * style.gutter_padding_factor;
+ let em_width = style.text.em_width(cx.font_cache());
+ gutter_padding = (em_width * style.gutter_padding_factor).round();
gutter_width = self.max_line_number_width(&snapshot, cx) + gutter_padding * 2.0;
gutter_margin = -style.text.descent(cx.font_cache());
} else {