Ver código fonte

Canvas2D: fix text vertical align issue

nockawa 8 anos atrás
pai
commit
8418cdcbb1

+ 1 - 1
canvas2D/src/Engine/babylon.fontTexture.ts

@@ -414,7 +414,7 @@
             this._context.textBaseline = "top";
 
             var res = this.getFontHeight(font);
-            this._lineHeightSuper = res.height+4;
+            this._lineHeightSuper = res.height; //+4;
             this._lineHeight = this._superSample ? (Math.ceil(this._lineHeightSuper / 2)) : this._lineHeightSuper;
             this._offset = res.offset - 1;
             this._xMargin = 1 + Math.ceil(this._lineHeightSuper / 15);    // Right now this empiric formula seems to work...

Diferenças do arquivo suprimidas por serem muito extensas
+ 4269 - 4269
dist/preview release/babylon.d.ts


+ 1 - 1
dist/preview release/canvas2D/babylon.canvas2d.js

@@ -1260,7 +1260,7 @@ var BABYLON;
             _this._context.fillStyle = "white";
             _this._context.textBaseline = "top";
             var res = _this.getFontHeight(font);
-            _this._lineHeightSuper = res.height + 4;
+            _this._lineHeightSuper = res.height; //+4;
             _this._lineHeight = _this._superSample ? (Math.ceil(_this._lineHeightSuper / 2)) : _this._lineHeightSuper;
             _this._offset = res.offset - 1;
             _this._xMargin = 1 + Math.ceil(_this._lineHeightSuper / 15); // Right now this empiric formula seems to work...

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 1
dist/preview release/canvas2D/babylon.canvas2d.min.js