Remove Editor::min_bounds and use bounds instead
This commit is contained in:
parent
8cad1d682a
commit
c7d02e24e6
5 changed files with 2 additions and 24 deletions
|
|
@ -131,10 +131,6 @@ impl text::Editor for () {
|
||||||
Size::ZERO
|
Size::ZERO
|
||||||
}
|
}
|
||||||
|
|
||||||
fn min_bounds(&self) -> Size {
|
|
||||||
Size::ZERO
|
|
||||||
}
|
|
||||||
|
|
||||||
fn update(
|
fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
_new_bounds: Size,
|
_new_bounds: Size,
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,6 @@ pub trait Editor: Sized + Default {
|
||||||
/// Returns the current boundaries of the [`Editor`].
|
/// Returns the current boundaries of the [`Editor`].
|
||||||
fn bounds(&self) -> Size;
|
fn bounds(&self) -> Size;
|
||||||
|
|
||||||
/// Returns the minimum boundaries that can fit the contents of the
|
|
||||||
/// [`Editor`].
|
|
||||||
fn min_bounds(&self) -> Size;
|
|
||||||
|
|
||||||
/// Updates the [`Editor`] with some new attributes.
|
/// Updates the [`Editor`] with some new attributes.
|
||||||
fn update(
|
fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|
@ -26,16 +22,6 @@ pub trait Editor: Sized + Default {
|
||||||
new_size: Pixels,
|
new_size: Pixels,
|
||||||
new_line_height: LineHeight,
|
new_line_height: LineHeight,
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Returns the minimum width that can fit the contents of the [`Editor`].
|
|
||||||
fn min_width(&self) -> f32 {
|
|
||||||
self.min_bounds().width
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns the minimum height that can fit the contents of the [`Editor`].
|
|
||||||
fn min_height(&self) -> f32 {
|
|
||||||
self.min_bounds().height
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
|
|
|
||||||
|
|
@ -410,10 +410,6 @@ impl editor::Editor for Editor {
|
||||||
self.internal().bounds
|
self.internal().bounds
|
||||||
}
|
}
|
||||||
|
|
||||||
fn min_bounds(&self) -> Size {
|
|
||||||
self.internal().min_bounds
|
|
||||||
}
|
|
||||||
|
|
||||||
fn update(
|
fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
new_bounds: Size,
|
new_bounds: Size,
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ impl Pipeline {
|
||||||
font_system.raw(),
|
font_system.raw(),
|
||||||
&mut self.glyph_cache,
|
&mut self.glyph_cache,
|
||||||
editor.buffer(),
|
editor.buffer(),
|
||||||
Rectangle::new(position, editor.min_bounds()),
|
Rectangle::new(position, editor.bounds()),
|
||||||
color,
|
color,
|
||||||
alignment::Horizontal::Left,
|
alignment::Horizontal::Left,
|
||||||
alignment::Vertical::Top,
|
alignment::Vertical::Top,
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ impl Pipeline {
|
||||||
|
|
||||||
(
|
(
|
||||||
editor.buffer(),
|
editor.buffer(),
|
||||||
Rectangle::new(*position, editor.min_bounds()),
|
Rectangle::new(*position, editor.bounds()),
|
||||||
alignment::Horizontal::Left,
|
alignment::Horizontal::Left,
|
||||||
alignment::Vertical::Top,
|
alignment::Vertical::Top,
|
||||||
*color,
|
*color,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue