Explorar o código

fix line height on reload with offset()

Nicolas Cannasse hai 9 meses
pai
achega
344ffa4cd5
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      h2d/domkit/BaseComponents.hx

+ 2 - 1
h2d/domkit/BaseComponents.hx

@@ -233,8 +233,9 @@ class CustomParser extends domkit.CssValue.ValueParser {
 		if( offsetChar != 0 && defChar != null )
 			offset = -Math.ceil(defChar.t.dy);
 		if( offset != 0 ) {
+			var prev = @:privateAccess fnt.offsetY;
 			fnt.setOffset(0,offset);
-			@:privateAccess fnt.lineHeight += offset;
+			@:privateAccess fnt.lineHeight += offset - prev;
 			@:privateAccess fnt.baseLine = fnt.calcBaseLine();
 		}
 		if( lineHeight != null && defChar != null ) {