mirror of
https://github.com/penpot/penpot.git
synced 2025-06-16 17:31:38 +02:00
🐛 Revert offset change to fix paragraph rendering
This commit is contained in:
parent
9800331505
commit
3c4be537d9
1 changed files with 3 additions and 1 deletions
|
@ -2,10 +2,12 @@ use super::{RenderState, Shape, SurfaceId};
|
||||||
use crate::shapes::TextContent;
|
use crate::shapes::TextContent;
|
||||||
|
|
||||||
pub fn render(render_state: &mut RenderState, shape: &Shape, text: &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()) {
|
for mut skia_paragraph in text.to_paragraphs(&render_state.fonts().font_collection()) {
|
||||||
skia_paragraph.layout(shape.width());
|
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);
|
skia_paragraph.paint(render_state.surfaces.canvas(SurfaceId::Fills), xy);
|
||||||
|
offset_y += skia_paragraph.height();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue