@galacean/engine 0.0.0-experimental-1.4-small-language.2 → 0.0.0-experimental-1.4-small-language.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +6 -2
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/module.js +1 -1
- package/package.json +5 -5
package/dist/browser.js
CHANGED
|
@@ -6611,7 +6611,7 @@
|
|
|
6611
6611
|
// Safari gets data confusion through getImageData when the canvas width is not an integer.
|
|
6612
6612
|
// The measure text width of some special invisible characters may be 0, so make sure the width is at least 1.
|
|
6613
6613
|
// @todo: Text layout may vary from standard and not support emoji.
|
|
6614
|
-
var _context_measureText = context.measureText(measureString), actualBoundingBoxLeft = _context_measureText.actualBoundingBoxLeft, actualBoundingBoxRight = _context_measureText.actualBoundingBoxRight, actualWidth = _context_measureText.width;
|
|
6614
|
+
var _context_measureText = context.measureText(measureString), actualBoundingBoxLeft = _context_measureText.actualBoundingBoxLeft, actualBoundingBoxRight = _context_measureText.actualBoundingBoxRight, fontBoundingBoxAscent = _context_measureText.fontBoundingBoxAscent, fontBoundingBoxDescent = _context_measureText.fontBoundingBoxDescent, actualWidth = _context_measureText.width;
|
|
6615
6615
|
// In some case (ex: " "), actualBoundingBoxRight and actualBoundingBoxLeft will be 0, so use width.
|
|
6616
6616
|
// TODO: With testing, actualBoundingBoxLeft + actualBoundingBoxRight is the actual rendering width
|
|
6617
6617
|
// but the space rules between characters are unclear. Using actualBoundingBoxRight + Math.abs(actualBoundingBoxLeft) is the closest to the native effect.
|
|
@@ -6620,6 +6620,10 @@
|
|
|
6620
6620
|
var baseline = Math.ceil(context.measureText(TextUtils._measureBaseline).width);
|
|
6621
6621
|
var height = baseline * TextUtils._heightMultiplier;
|
|
6622
6622
|
baseline = TextUtils._baselineMultiplier * baseline | 0;
|
|
6623
|
+
if (!this.useImageData) {
|
|
6624
|
+
height = Math.round(TextUtils._heightMultiplier * (fontBoundingBoxAscent + fontBoundingBoxDescent));
|
|
6625
|
+
baseline = Math.round(height / 4 + fontBoundingBoxAscent);
|
|
6626
|
+
}
|
|
6623
6627
|
var _extendHeight = TextUtils._extendHeight;
|
|
6624
6628
|
height += _extendHeight;
|
|
6625
6629
|
baseline += _extendHeight * 0.5;
|
|
@@ -50363,7 +50367,7 @@
|
|
|
50363
50367
|
], EXT_texture_webp);
|
|
50364
50368
|
|
|
50365
50369
|
//@ts-ignore
|
|
50366
|
-
var version = "0.0.0-experimental-1.4-small-language.
|
|
50370
|
+
var version = "0.0.0-experimental-1.4-small-language.3";
|
|
50367
50371
|
console.log("Galacean Engine Version: " + version);
|
|
50368
50372
|
for(var key in CoreObjects){
|
|
50369
50373
|
Loader.registerClass(key, CoreObjects[key]);
|