From c4e60d7dbd7e781c847418a2419cb0bc3fee1a52 Mon Sep 17 00:00:00 2001 From: Marko Koschak Date: Wed, 24 Jul 2024 17:43:42 +0200 Subject: [PATCH] Add offset to rendered text in ObjectRenderSystem --- .../korlibs/korge/fleks/renderSystems/ObjectRenderSystem.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/korge-fleks/src/commonMain/kotlin/korlibs/korge/fleks/renderSystems/ObjectRenderSystem.kt b/korge-fleks/src/commonMain/kotlin/korlibs/korge/fleks/renderSystems/ObjectRenderSystem.kt index 129491f..fe06919 100644 --- a/korge-fleks/src/commonMain/kotlin/korlibs/korge/fleks/renderSystems/ObjectRenderSystem.kt +++ b/korge-fleks/src/commonMain/kotlin/korlibs/korge/fleks/renderSystems/ObjectRenderSystem.kt @@ -110,6 +110,7 @@ class ObjectRenderSystem( // Rendering path for text else if (entity has TextFieldComponent) { val (text, fontName, textRangeStart, textRangeEnd, width, height, wordWrap, horizontalAlign, verticalAlign) = entity[TextFieldComponent] + val offset: Point = Point(offsetX, offsetY) renderCtx2d(ctx) { render -> var n = 0 @@ -130,7 +131,7 @@ class ObjectRenderSystem( it.text, it.font.lazyBitmap, it.size, - it.pos, + it.pos + offset, color = rgba, baseline = true, textRangeStart = textRangeStart - n,