Skip to content

Commit 0000d72

Browse files
committed
Use max_physical_height
1 parent 1e89f58 commit 0000d72

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/core/textlayout/sharedparley.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ impl Default for LayoutOptions {
7070

7171
pub fn layout(text: &str, scale_factor: ScaleFactor, options: LayoutOptions) -> Layout {
7272
let max_physical_width = options.max_width.map(|max_width| (max_width * scale_factor).get());
73+
let max_physical_height = options.max_height.map(|max_height| max_height * scale_factor);
7374
let pixel_size = options
7475
.font_request
7576
.as_ref()
@@ -127,7 +128,7 @@ pub fn layout(text: &str, scale_factor: ScaleFactor, options: LayoutOptions) ->
127128
parley::AlignmentOptions::default(),
128129
);
129130

130-
let y_offset = match (options.max_height, options.vertical_align) {
131+
let y_offset = match (max_physical_height, options.vertical_align) {
131132
(Some(max_height), TextVerticalAlignment::Center) => {
132133
(max_height.get() - layout.height()) / 2.0
133134
}

0 commit comments

Comments
 (0)