0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-06 12:01:19 -05:00

🐛 Revert offset change to fix paragraph rendering

This commit is contained in:
Elena Torro 2025-03-27 17:17:36 +01:00
parent 9800331505
commit 3c4be537d9

View file

@ -2,10 +2,12 @@ use super::{RenderState, Shape, SurfaceId};
use crate::shapes::TextContent;
pub fn render(render_state: &mut RenderState, shape: &Shape, text: &TextContent) {
let mut offset_y = 0.0;
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());
let xy = (shape.selrect().x(), shape.selrect.y() + offset_y);
skia_paragraph.paint(render_state.surfaces.canvas(SurfaceId::Fills), xy);
offset_y += skia_paragraph.height();
}
}