Skip to content

Commit

Permalink
fix font offset being relative after reload
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Dec 19, 2024
1 parent 3dfdd6f commit ee7406b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion h2d/domkit/BaseComponents.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ee7406b

Please sign in to comment.