mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 19:28:12 +00:00
🐛 Revert offset change to fix paragraph rendering
This commit is contained in:
parent
9800331505
commit
3c4be537d9
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user