Prevent some cases of clipping icons due to pixel coord rounding

This commit is contained in:
Julia 2023-05-08 11:32:57 -04:00
parent 235470bbfd
commit 332b364a30
2 changed files with 3 additions and 2 deletions

View File

@ -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(

View File

@ -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 {