Skip to content
Snippets Groups Projects
Commit 0e5e54f7 authored by sam edelsten's avatar sam edelsten
Browse files

fix dropped metrics causing scaling issues

parent db074eb6
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,10 @@
BUGS INTRODUCED:
[ ] Font size has been changed somehow
[ ] No cursor on readonly
[ ] Window resizing broken
\ No newline at end of file
[ ] Cursor on readonly
[ ] Window resizing broken
Used to redraw on click, now redraws on scroll or drag?
BUGS SQUASHED:
[x] Font size has been changed somehow
\ No newline at end of file
......@@ -71,10 +71,13 @@ impl Default for CosmicEditor {
/// Adds the font system to each editor when added
fn cosmic_editor_builder(
mut added_editors: Query<(&mut CosmicEditor, &CosmicAttrs), Added<CosmicEditor>>,
mut added_editors: Query<
(&mut CosmicEditor, &CosmicAttrs, &CosmicMetrics),
Added<CosmicEditor>,
>,
mut font_system: ResMut<CosmicFontSystem>,
) {
for (mut editor, attrs) in added_editors.iter_mut() {
for (mut editor, attrs, metrics) in added_editors.iter_mut() {
// keep old text if set
let mut text = get_cosmic_text(editor.0.buffer());
......@@ -89,6 +92,11 @@ fn cosmic_editor_builder(
Shaping::Advanced,
);
editor.0.buffer_mut().set_metrics(
&mut font_system.0,
Metrics::new(metrics.font_size, metrics.line_height).scale(metrics.scale_factor),
);
editor
.0
.buffer_mut() // TODO size here????
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment