mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-29 08:02:12 +03:00
Avoid rendering artifacts when label text is shaped with a non-integer width
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
6fba17a5e1
commit
e37ea6c6c8
@ -135,7 +135,10 @@ impl Element for Label {
|
||||
);
|
||||
|
||||
let size = vec2f(
|
||||
line.width().max(constraint.min.x()).min(constraint.max.x()),
|
||||
line.width()
|
||||
.ceil()
|
||||
.max(constraint.min.x())
|
||||
.min(constraint.max.x()),
|
||||
cx.font_cache
|
||||
.line_height(self.style.text.font_id, self.style.text.font_size),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user