Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issue #2002] Ensure that absolute LineHeight is always > 0.0 #2059

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tiny_skia/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,10 @@ impl Cache {
}

if let hash_map::Entry::Vacant(entry) = self.entries.entry(hash) {
let metrics = cosmic_text::Metrics::new(key.size, key.size * 1.2);
let metrics = cosmic_text::Metrics::new(
key.size,
key.line_height.max(f32::MIN_POSITIVE),
);
let mut buffer = cosmic_text::Buffer::new(font_system, metrics);

buffer.set_size(
Expand Down
5 changes: 4 additions & 1 deletion wgpu/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,10 @@ impl Cache {
}

if let hash_map::Entry::Vacant(entry) = self.entries.entry(hash) {
let metrics = glyphon::Metrics::new(key.size, key.line_height);
let metrics = glyphon::Metrics::new(
key.size,
key.line_height.max(f32::MIN_POSITIVE),
);
let mut buffer = glyphon::Buffer::new(font_system, metrics);

buffer.set_size(
Expand Down