Make wrap guides respect scroll position (#2810)
Release Notes: - Fixed a visual bug when scrolling with wrap guides active
This commit is contained in:
commit
4626981b25
1 changed files with 11 additions and 1 deletions
|
@ -546,8 +546,18 @@ impl EditorElement {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let scroll_left =
|
||||||
|
layout.position_map.snapshot.scroll_position().x() * layout.position_map.em_width;
|
||||||
|
|
||||||
for (wrap_position, active) in layout.wrap_guides.iter() {
|
for (wrap_position, active) in layout.wrap_guides.iter() {
|
||||||
let x = text_bounds.origin_x() + wrap_position + layout.position_map.em_width / 2.;
|
let x =
|
||||||
|
(text_bounds.origin_x() + wrap_position + layout.position_map.em_width / 2.)
|
||||||
|
- scroll_left;
|
||||||
|
|
||||||
|
if x < text_bounds.origin_x() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let color = if *active {
|
let color = if *active {
|
||||||
self.style.active_wrap_guide
|
self.style.active_wrap_guide
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue