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:
co-authored by
Nathan Sobo
parent
6fba17a5e1
commit
e37ea6c6c8
@@ -135,7 +135,10 @@ impl Element for Label {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let size = vec2f(
|
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
|
cx.font_cache
|
||||||
.line_height(self.style.text.font_id, self.style.text.font_size),
|
.line_height(self.style.text.font_id, self.style.text.font_size),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user