mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-03 17:38:27 +00:00
Only use a single buffer
This commit is contained in:
parent
a20b8e56e1
commit
cb0cc6b383
@ -70,24 +70,26 @@ impl TextRenderer {
|
||||
) -> anyhow::Result<()> {
|
||||
let mut buffers = Vec::new();
|
||||
|
||||
for op in &operations.operations {
|
||||
let mut buffer = glyphon::Buffer::new(
|
||||
&mut self.font_system,
|
||||
glyphon::Metrics {
|
||||
font_size: 16.,
|
||||
line_height: 16.,
|
||||
},
|
||||
);
|
||||
buffer.set_text(
|
||||
&mut self.font_system,
|
||||
&format!("{op}"),
|
||||
glyphon::Attrs::new(),
|
||||
glyphon::Shaping::Advanced,
|
||||
);
|
||||
let mut buffer = glyphon::Buffer::new(
|
||||
&mut self.font_system,
|
||||
glyphon::Metrics {
|
||||
font_size: 16.,
|
||||
line_height: 16.,
|
||||
},
|
||||
);
|
||||
|
||||
buffers.push(buffer);
|
||||
for op in &operations.operations {
|
||||
buffer.lines.push(glyphon::BufferLine::new(
|
||||
format!("{op}"),
|
||||
glyphon::cosmic_text::LineEnding::Lf,
|
||||
glyphon::AttrsList::new(glyphon::Attrs::new()),
|
||||
glyphon::Shaping::Advanced,
|
||||
));
|
||||
}
|
||||
|
||||
buffer.shape_until_scroll(&mut self.font_system, false);
|
||||
buffers.push(buffer);
|
||||
|
||||
let mut text_areas = Vec::new();
|
||||
let mut top = 0.;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user