Skip to content

Commit 3519b4d

Browse files
authored
Remove
1 parent 7c1ae2e commit 3519b4d

File tree

1 file changed

+40
-40
lines changed
  • neothesia-core/src/render/keyboard

1 file changed

+40
-40
lines changed

neothesia-core/src/render/keyboard/mod.rs

+40-40
Original file line numberDiff line numberDiff line change
@@ -124,47 +124,47 @@ impl KeyboardRenderer {
124124
}
125125
}
126126

127-
#[profiling::function]
128-
fn rebuild_text_cache(&mut self, font_system: &mut glyphon::FontSystem) {
129-
let range_start = self.layout.range.start() as usize;
130-
for key in self.layout.keys.iter().filter(|key| key.note_id() == 0) {
131-
let x = self.pos.x + key.x();
132-
let y = self.pos.y;
133-
134-
let w = key.width();
135-
let h = key.height();
136-
137-
let size = w * 0.7;
138-
139-
let oct_number = (key.id() + range_start) / 12;
140-
141-
let mut buffer = glyphon::Buffer::new(font_system, glyphon::Metrics::new(size, size));
142-
buffer.set_size(font_system, Some(w), Some(h));
143-
buffer.set_wrap(font_system, glyphon::Wrap::None);
144-
buffer.set_text(
145-
font_system,
146-
&format!("C{}", oct_number as i8 - 1),
147-
glyphon::Attrs::new().family(glyphon::Family::SansSerif),
148-
glyphon::Shaping::Basic,
149-
);
150-
buffer.lines[0].set_align(Some(glyphon::cosmic_text::Align::Center));
151-
buffer.shape_until_scroll(font_system, false);
152-
153-
self.text_cache.push(super::text::TextArea {
154-
buffer,
155-
left: x,
156-
top: y + h - size * 1.2,
157-
scale: 1.0,
158-
bounds: glyphon::TextBounds {
159-
left: x.round() as i32,
160-
top: y.round() as i32,
161-
right: x.round() as i32 + w.round() as i32,
162-
bottom: y.round() as i32 + h.round() as i32,
163-
},
164-
default_color: glyphon::Color::rgb(153, 153, 153),
165-
});
166-
}
127+
#[profiling::function]
128+
fn rebuild_text_cache(&mut self, font_system: &mut glyphon::FontSystem) {
129+
let range_start = self.layout.range.start() as usize;
130+
for key in self.layout.keys.iter() {
131+
let x = self.pos.x + key.x();
132+
let y = self.pos.y;
133+
134+
let w = key.width();
135+
let h = key.height();
136+
137+
let size = w * 0.7;
138+
139+
let oct_number = (key.id() + range_start) / 12;
140+
141+
let mut buffer = glyphon::Buffer::new(font_system, glyphon::Metrics::new(size, size));
142+
buffer.set_size(font_system, Some(w), Some(h));
143+
buffer.set_wrap(font_system, glyphon::Wrap::None);
144+
buffer.set_text(
145+
font_system,
146+
&format!("C{}", oct_number as i8 - 1),
147+
glyphon::Attrs::new().family(glyphon::Family::SansSerif),
148+
glyphon::Shaping::Basic,
149+
);
150+
buffer.lines[0].set_align(Some(glyphon::cosmic_text::Align::Center));
151+
buffer.shape_until_scroll(font_system, false);
152+
153+
self.text_cache.push(super::text::TextArea {
154+
buffer,
155+
left: x,
156+
top: y + h - size * 1.2,
157+
scale: 1.0,
158+
bounds: glyphon::TextBounds {
159+
left: x.round() as i32,
160+
top: y.round() as i32,
161+
right: x.round() as i32 + w.round() as i32,
162+
bottom: y.round() as i32 + h.round() as i32,
163+
},
164+
default_color: glyphon::Color::rgb(153, 153, 153),
165+
});
167166
}
167+
}
168168

169169
#[profiling::function]
170170
pub fn update(&mut self, quads: &mut QuadPipeline, layer: usize, text: &mut TextRenderer) {

0 commit comments

Comments
 (0)