From ee7406b715de1f26effad47382a8d1aae135c5ad Mon Sep 17 00:00:00 2001 From: Nicolas Cannasse Date: Thu, 19 Dec 2024 17:54:08 +0100 Subject: [PATCH] fix font offset being relative after reload --- h2d/domkit/BaseComponents.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h2d/domkit/BaseComponents.hx b/h2d/domkit/BaseComponents.hx index edf37e65e..aac7172ba 100644 --- a/h2d/domkit/BaseComponents.hx +++ b/h2d/domkit/BaseComponents.hx @@ -229,7 +229,7 @@ class CustomParser extends domkit.CssValue.ValueParser { fnt = res.to(hxd.res.BitmapFont).toFont(); var defChar = offsetChar <= 0 ? fnt.getChar("A".code) ?? fnt.getChar("0".code) ?? fnt.getChar("a".code) : fnt.getChar(offsetChar); if( offsetChar != 0 && defChar != null ) - offset = -Math.ceil(defChar.t.dy); + offset = -Math.ceil(defChar.t.dy) + Std.int(@:privateAccess fnt.offsetY); if( offset != null || baseLine != null) { var prev = @:privateAccess fnt.offsetY; fnt.setOffset(0,offset);