Skip to content

Commit

Permalink
Updated cosmic-text to 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ecton committed Jul 22, 2024
1 parent ffe9996 commit a0e3405
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## v0.9.0 (2024-07-22)

### Breaking Changes

- `wgpu` has been updated to `22.0.0`.
- `cosmic-text` has been updated to `0.12.0`.

### Added

Expand Down
28 changes: 17 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pollster = "0.3.0"
bytemuck = { version = "1.13.1", features = ["derive"] }
lyon_tessellation = "1.0.1"
image = { version = "0.25.1", optional = true, default-features = false }
cosmic-text = { version = "0.11.2", optional = true }
cosmic-text = { version = "0.12.0", optional = true }
alot = "0.3.0"
ahash = "0.8.3"
etagere = "0.2.8"
Expand Down
8 changes: 4 additions & 4 deletions examples/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ impl WindowBehavior for Test {
);
text.set_size(
graphics.font_system(),
size.width.into_float(),
size.height.into_float(),
Some(size.width.into_float()),
Some(size.height.into_float()),
);
let mut editor = Editor::new(&mut text);
editor.insert_string("Hello, ", None);
Expand Down Expand Up @@ -65,8 +65,8 @@ impl WindowBehavior for Test {
let size = graphics.size();
self.text.set_size(
graphics.font_system(),
size.width.into_float(),
size.height.into_float(),
Some(size.width.into_float()),
Some(size.height.into_float()),
);
self.text.set_metrics(
graphics.font_system(),
Expand Down
6 changes: 1 addition & 5 deletions src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,7 @@ impl TextSystem {
self.attrs.as_attrs(),
cosmic_text::Shaping::Advanced, // TODO maybe this should be configurable?
);
scratch.set_size(
&mut self.fonts,
width.map_or(f32::MAX, Cast::cast),
f32::MAX,
);
scratch.set_size(&mut self.fonts, width.map(Cast::cast), None);
scratch.shape_until_scroll(&mut self.fonts, false);
}
}
Expand Down

0 comments on commit a0e3405

Please sign in to comment.