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.

Fix porting mistake that caused clicking on the editor to misbehave

Antonio Scandurrab4fc8ea6f7bd
diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs
index 4e444ee1892..01eec607cd0 100644
--- a/crates/editor2/src/element.rs
+++ b/crates/editor2/src/element.rs
@@ -2950,7 +2950,7 @@ impl PositionMap {
) -> PointForPosition {
let scroll_position = self.snapshot.scroll_position();
let position = position - text_bounds.origin;
- let y = position.y.max(px(0.)).min(self.size.width);
+ let y = position.y.max(px(0.)).min(self.size.height);
let x = position.x + (scroll_position.x * self.em_width);
let row = (f32::from(y / self.line_height) + scroll_position.y) as u32;