mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-24 07:32:51 +00:00
Fix porting mistake that caused clicking on the editor to misbehave (#3583)
We used `width` instead of `height` in the "pixels-to-point" conversion code, which would cause clicks to not work correctly when the width was smaller than the `y` coordinate. Release Notes: - N/A
This commit is contained in:
commit
db39c3d582
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue