Change summary
crates/gpui2/src/elements/text.rs | 7 ++++++-
crates/gpui2/src/geometry.rs | 4 ++++
2 files changed, 10 insertions(+), 1 deletion(-)
Detailed changes
@@ -101,7 +101,12 @@ impl<V: 'static> Element<V> for Text<V> {
.map(|line| line.wrap_count() + 1)
.sum::<usize>();
let size = Size {
- width: lines.iter().map(|line| line.layout.width).max().unwrap(),
+ width: lines
+ .iter()
+ .map(|line| line.layout.width)
+ .max()
+ .unwrap()
+ .ceil(),
height: line_height * line_count,
};
@@ -785,6 +785,10 @@ impl Pixels {
Self(self.0.round())
}
+ pub fn ceil(&self) -> Self {
+ Self(self.0.ceil())
+ }
+
pub fn scale(&self, factor: f32) -> ScaledPixels {
ScaledPixels(self.0 * factor)
}