🐛 Fix paragraph layout width on autowidth

This commit is contained in:
Elena Torro
2025-08-22 10:00:23 +02:00
parent c0c2c9489c
commit 46b3e174ed
7 changed files with 99 additions and 107 deletions

View File

@@ -1,7 +1,6 @@
use crate::shapes::text::TextContent;
use skia_safe::{
self as skia, textlayout::Paragraph as SkiaParagraph, textlayout::ParagraphBuilder,
FontMetrics, Point, Rect, TextBlob,
self as skia, textlayout::Paragraph as SkiaParagraph, FontMetrics, Point, Rect, TextBlob,
};
use std::ops::Deref;
@@ -17,16 +16,11 @@ impl TextPaths {
Self(content)
}
pub fn get_skia_paragraphs(&self) -> Vec<Vec<ParagraphBuilder>> {
let paragraphs = self.to_paragraphs(None, None);
self.collect_paragraphs(paragraphs)
}
pub fn get_paths(&self, antialias: bool) -> Vec<(skia::Path, skia::Paint)> {
let mut paths = Vec::new();
let mut offset_y = self.bounds.y();
let mut paragraphs = self.get_skia_paragraphs();
let mut paragraphs = self.to_paragraphs(None, None);
for paragraphs in paragraphs.iter_mut() {
for paragraph_builder in paragraphs.iter_mut() {