🔧 Refactor ParagraphBuilder and fix auto height

This commit is contained in:
Elena Torro
2025-07-11 13:29:22 +02:00
parent 4c21468850
commit b40b1fa2e4
9 changed files with 161 additions and 166 deletions

View File

@@ -1,4 +1,4 @@
use skia_safe::{self as skia, Path, Point};
use skia_safe::{self as skia, textlayout::FontCollection, Path, Point};
use std::collections::HashMap;
mod shapes_pool;
@@ -167,6 +167,10 @@ impl State {
.rebuild_modifier_tiles(&self.shapes, &self.modifiers);
}
pub fn font_collection(&self) -> &FontCollection {
self.render_state.fonts().font_collection()
}
pub fn get_grid_coords(&self, pos_x: f32, pos_y: f32) -> Option<(i32, i32)> {
let shape = self.current_shape()?;
let bounds = shape.bounds();