mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-09 12:28:29 +00:00
Only use a single buffer
This commit is contained in:
parent
a20b8e56e1
commit
cb0cc6b383
@ -70,7 +70,6 @@ impl TextRenderer {
|
|||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
let mut buffers = Vec::new();
|
let mut buffers = Vec::new();
|
||||||
|
|
||||||
for op in &operations.operations {
|
|
||||||
let mut buffer = glyphon::Buffer::new(
|
let mut buffer = glyphon::Buffer::new(
|
||||||
&mut self.font_system,
|
&mut self.font_system,
|
||||||
glyphon::Metrics {
|
glyphon::Metrics {
|
||||||
@ -78,16 +77,19 @@ impl TextRenderer {
|
|||||||
line_height: 16.,
|
line_height: 16.,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
buffer.set_text(
|
|
||||||
&mut self.font_system,
|
|
||||||
&format!("{op}"),
|
|
||||||
glyphon::Attrs::new(),
|
|
||||||
glyphon::Shaping::Advanced,
|
|
||||||
);
|
|
||||||
|
|
||||||
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 text_areas = Vec::new();
|
||||||
let mut top = 0.;
|
let mut top = 0.;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user