Skip to content

Commit d3b42c9

Browse files
committed
Fix applying word wrap calling the old paths for formatting, being incredibly slow.
1 parent 04d051f commit d3b42c9

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

crates/paperback/src/ui/document_manager.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,13 @@ impl DocumentManager {
567567
}
568568
apply_foreground_color_to_ctrl(text_ctrl, rf.color);
569569
apply_bg_color_to_ctrl(text_ctrl, bg_color);
570-
apply_line_spacing_to_ctrl(text_ctrl, line_spacing);
571-
apply_paragraph_spacing_to_ctrl(text_ctrl, paragraph_spacing);
572-
apply_letter_spacing_to_ctrl(text_ctrl, letter_spacing);
573-
apply_text_alignment_to_ctrl(text_ctrl, text_alignment);
570+
apply_readability_format_to_ctrl(
571+
text_ctrl,
572+
line_spacing,
573+
paragraph_spacing,
574+
letter_spacing,
575+
text_alignment,
576+
);
574577
let max_pos = text_ctrl.get_last_position();
575578
let pos = current_pos.clamp(0, max_pos);
576579
tab.panel.layout();

0 commit comments

Comments
 (0)