use Buffer::new_empty in Buffer::new
This commit is contained in:
parent
cfb6760fa2
commit
2ed9c34796
1 changed files with 1 additions and 11 deletions
|
|
@ -354,17 +354,7 @@ impl Buffer {
|
||||||
///
|
///
|
||||||
/// Will panic if `metrics.line_height` is zero.
|
/// Will panic if `metrics.line_height` is zero.
|
||||||
pub fn new(font_system: &mut FontSystem, metrics: Metrics) -> Self {
|
pub fn new(font_system: &mut FontSystem, metrics: Metrics) -> Self {
|
||||||
assert_ne!(metrics.line_height, 0.0, "line height cannot be 0");
|
let mut buffer = Self::new_empty(metrics);
|
||||||
|
|
||||||
let mut buffer = Self {
|
|
||||||
lines: Vec::new(),
|
|
||||||
metrics,
|
|
||||||
width: 0.0,
|
|
||||||
height: 0.0,
|
|
||||||
scroll: 0,
|
|
||||||
redraw: false,
|
|
||||||
wrap: Wrap::Word,
|
|
||||||
};
|
|
||||||
buffer.set_text(font_system, "", Attrs::new(), Shaping::Advanced);
|
buffer.set_text(font_system, "", Attrs::new(), Shaping::Advanced);
|
||||||
buffer
|
buffer
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue