From f241b6f0adf0e85ce02de07ff18148c23d84c983 Mon Sep 17 00:00:00 2001 From: Nicolas Cannasse Date: Wed, 11 Dec 2024 17:56:16 +0100 Subject: [PATCH] fixed @offset implementation to offset glyphs and not only baseline. --- h2d/domkit/BaseComponents.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/h2d/domkit/BaseComponents.hx b/h2d/domkit/BaseComponents.hx index 7ce95b14d..4aec240d9 100644 --- a/h2d/domkit/BaseComponents.hx +++ b/h2d/domkit/BaseComponents.hx @@ -215,8 +215,10 @@ class CustomParser extends domkit.CssValue.ValueParser { fnt = res.to(hxd.res.BitmapFont).toSdfFont(sdf.size, sdf.channel, sdf.cutoff, sdf.smooth); else fnt = res.to(hxd.res.BitmapFont).toFont(); - if( offset != 0 ) - @:privateAccess fnt.baseLine = fnt.calcBaseLine() - offset; + if( offset != 0 ) { + fnt.setOffset(0,offset); + @:privateAccess fnt.baseLine = fnt.calcBaseLine(); + } return fnt; #end }