mirror of
https://github.com/penpot/penpot.git
synced 2025-06-08 06:01:38 +02:00
11 lines
448 B
Rust
11 lines
448 B
Rust
use super::{RenderState, Shape, SurfaceId};
|
|
use crate::shapes::TextContent;
|
|
|
|
pub fn render(render_state: &mut RenderState, shape: &Shape, text: &TextContent) {
|
|
for mut skia_paragraph in text.to_paragraphs(&render_state.fonts().font_collection()) {
|
|
skia_paragraph.layout(shape.width());
|
|
|
|
let xy = (shape.selrect().x(), shape.selrect.y());
|
|
skia_paragraph.paint(render_state.surfaces.canvas(SurfaceId::Fills), xy);
|
|
}
|
|
}
|