mirror of
https://github.com/hannobraun/Fornjot
synced 2025-10-18 13:58:05 +00:00
Simplify
This commit is contained in:
parent
cb0cc6b383
commit
9b5ed60434
@ -68,8 +68,6 @@ impl TextRenderer {
|
||||
surface_config: &wgpu::SurfaceConfiguration,
|
||||
render_pass: &mut wgpu::RenderPass,
|
||||
) -> anyhow::Result<()> {
|
||||
let mut buffers = Vec::new();
|
||||
|
||||
let mut buffer = glyphon::Buffer::new(
|
||||
&mut self.font_system,
|
||||
glyphon::Metrics {
|
||||
@ -88,29 +86,24 @@ impl TextRenderer {
|
||||
}
|
||||
|
||||
buffer.shape_until_scroll(&mut self.font_system, false);
|
||||
buffers.push(buffer);
|
||||
|
||||
let mut text_areas = Vec::new();
|
||||
let mut top = 0.;
|
||||
let top = 0.;
|
||||
|
||||
for buffer in &buffers {
|
||||
text_areas.push(glyphon::TextArea {
|
||||
buffer,
|
||||
left: 0.,
|
||||
top,
|
||||
scale: self.scale_factor,
|
||||
bounds: glyphon::TextBounds {
|
||||
left: 0,
|
||||
top: 0,
|
||||
right: surface_config.width as i32,
|
||||
bottom: surface_config.height as i32,
|
||||
},
|
||||
default_color: glyphon::Color::rgb(0, 0, 0),
|
||||
custom_glyphs: &[],
|
||||
});
|
||||
|
||||
top += 20.0 * self.scale_factor;
|
||||
}
|
||||
text_areas.push(glyphon::TextArea {
|
||||
buffer: &buffer,
|
||||
left: 0.,
|
||||
top,
|
||||
scale: self.scale_factor,
|
||||
bounds: glyphon::TextBounds {
|
||||
left: 0,
|
||||
top: 0,
|
||||
right: surface_config.width as i32,
|
||||
bottom: surface_config.height as i32,
|
||||
},
|
||||
default_color: glyphon::Color::rgb(0, 0, 0),
|
||||
custom_glyphs: &[],
|
||||
});
|
||||
|
||||
self.text_renderer
|
||||
.prepare(
|
||||
|
Loading…
x
Reference in New Issue
Block a user