mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
🔧 Refactor ParagraphBuilder and fix auto height
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user