mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-24 07:32:51 +00:00
Fix position calculation (#3854)
Fixes a bug where the context menu appears in the wrong place
This commit is contained in:
commit
e43be065d9
1 changed files with 3 additions and 1 deletions
|
@ -149,7 +149,9 @@ impl Element for Overlay {
|
|||
desired.origin.y = limits.origin.y;
|
||||
}
|
||||
|
||||
cx.with_element_offset(desired.origin - bounds.origin, |cx| {
|
||||
let mut offset = cx.element_offset() + desired.origin - bounds.origin;
|
||||
offset = point(offset.x.round(), offset.y.round());
|
||||
cx.with_absolute_element_offset(offset, |cx| {
|
||||
cx.break_content_mask(|cx| {
|
||||
for child in &mut self.children {
|
||||
child.paint(cx);
|
||||
|
|
Loading…
Reference in a new issue