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:
1 parent
6fba17a5e1
commit
e37ea6c6c8
1 file changed
+4
-1
@@ -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),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user