Remove dead code

The height method on FontMetrics is not needed anymore. We call `text_size` nowadays.
This commit is contained in:
Simon Hausmann 2021-04-13 11:26:13 +02:00
parent f07a4ec8cf
commit f42d759131
3 changed files with 0 additions and 22 deletions

View file

@ -135,10 +135,6 @@ pub trait FontMetrics {
/// for example when receiving a mouse click into a text field. Then this function returns the "cursor"
/// position.
fn text_offset_for_x_position<'a>(&self, text: &'a str, x: f32) -> usize;
/// Returns the height of the font. This is typically the sum of the ascent and the descent, resulting
/// in the height that can fit the talltest glyphs of the font. Note that it is possible though that
/// the font may include glyphs that exceed this.
fn height(&self) -> f32;
}
#[cfg(feature = "ffi")]

View file

@ -1420,18 +1420,6 @@ impl FontMetrics for GLFontMetrics {
}
return text.len();
}
fn height(&self) -> f32 {
self.shared_data
.canvas
.borrow_mut()
.measure_font(self.font().init_paint(
self.request.letter_spacing.unwrap_or_default(),
femtovg::Paint::default(),
))
.unwrap()
.height()
}
}
impl GLFontMetrics {

View file

@ -1075,12 +1075,6 @@ impl sixtyfps_corelib::graphics::FontMetrics for QFont {
return QStringView(string).left(cur).toUtf8().size();
}}
}
fn height(&self) -> f32 {
cpp! { unsafe [self as "const QFont*"] -> f32 as "float"{
return QFontMetricsF(*self).height();
}}
}
}
thread_local! {