JetBrains / skija

Java bindings for Skia
Apache License 2.0
2.63k stars 128 forks source link

Paragraph.getLineMetrics() hangs when paragraph contains placeholder #74

Closed igordmn closed 3 years ago

igordmn commented 3 years ago
val fontCollection = FontCollection().setDefaultFontManager(FontMgr.getDefault())
val style = ParagraphStyle()
val paragraph = ParagraphBuilder(style, fontCollection)
        .pushStyle(TextStyle().setColor(0xFF000000.toInt()))
        .addText("Text")
        .addPlaceholder(PlaceholderStyle(2f, 2f, PlaceholderAlignment.BASELINE, BaselineMode.ALPHABETIC, 0f))
        .popStyle()
        .build()
paragraph.layout(Float.POSITIVE_INFINITY)
paragraph.paint(canvas, 0f, 0f)
paragraph.getLineMetrics()

Reproduced on https://github.com/JetBrains/skija/commit/b703f6eb5dd709cf50b6ca2f854ffb5251dff6d4 and isn't reproduced before it