mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Remove dead code
The height method on FontMetrics is not needed anymore. We call `text_size` nowadays.
This commit is contained in:
parent
f07a4ec8cf
commit
f42d759131
3 changed files with 0 additions and 22 deletions
|
@ -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")]
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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! {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue