Skip to content

Commit 0053fd1

Browse files
committed
Adapt to new cosmic-text
1 parent 09a9525 commit 0053fd1

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

graphics/src/geometry/text.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl Text {
4444
let mut buffer = cosmic_text::BufferLine::new(
4545
&self.content,
4646
cosmic_text::LineEnding::default(),
47-
cosmic_text::AttrsList::new(text::to_attributes(self.font)),
47+
cosmic_text::AttrsList::new(&text::to_attributes(self.font)),
4848
text::to_shaping(self.shaping),
4949
);
5050

graphics/src/text/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl Cache {
5454
buffer.set_text(
5555
font_system,
5656
key.content,
57-
text::to_attributes(key.font),
57+
&text::to_attributes(key.font),
5858
text::to_shaping(key.shaping),
5959
);
6060

graphics/src/text/editor.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl editor::Editor for Editor {
7171
buffer.set_text(
7272
font_system.raw(),
7373
text,
74-
cosmic_text::Attrs::new(),
74+
&cosmic_text::Attrs::new(),
7575
cosmic_text::Shaping::Advanced,
7676
);
7777

@@ -465,7 +465,7 @@ impl editor::Editor for Editor {
465465

466466
for line in buffer.lines.iter_mut() {
467467
let _ = line.set_attrs_list(cosmic_text::AttrsList::new(
468-
text::to_attributes(new_font),
468+
&text::to_attributes(new_font),
469469
));
470470
}
471471

@@ -573,20 +573,20 @@ impl editor::Editor for Editor {
573573
for line in &mut buffer_mut_from_editor(&mut internal.editor).lines
574574
[current_line..=last_visible_line]
575575
{
576-
let mut list = cosmic_text::AttrsList::new(attributes);
576+
let mut list = cosmic_text::AttrsList::new(&attributes);
577577

578578
for (range, highlight) in highlighter.highlight_line(line.text()) {
579579
let format = format_highlight(&highlight);
580580

581581
if format.color.is_some() || format.font.is_some() {
582582
list.add_span(
583583
range,
584-
cosmic_text::Attrs {
584+
&cosmic_text::Attrs {
585585
color_opt: format.color.map(text::to_color),
586586
..if let Some(font) = format.font {
587587
text::to_attributes(font)
588588
} else {
589-
attributes
589+
attributes.clone()
590590
}
591591
},
592592
);

graphics/src/text/paragraph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl core::text::Paragraph for Paragraph {
8585
buffer.set_text(
8686
font_system.raw(),
8787
text.content,
88-
text::to_attributes(text.font),
88+
&text::to_attributes(text.font),
8989
text::to_shaping(text.shaping),
9090
);
9191

@@ -152,7 +152,7 @@ impl core::text::Paragraph for Paragraph {
152152

153153
(span.text.as_ref(), attrs.metadata(i))
154154
}),
155-
text::to_attributes(text.font),
155+
&text::to_attributes(text.font),
156156
text::to_shaping(text.shaping),
157157
Some(match text.horizontal_alignment {
158158
alignment::Horizontal::Left => cosmic_text::Align::Left,

0 commit comments

Comments
 (0)