@galacean/engine-core 1.1.0-beta.35 → 1.1.0-beta.36

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.
@@ -1948,13 +1948,15 @@ var Logger = {
1948
1948
  ];
1949
1949
  })();
1950
1950
  (function() {
1951
- /** These characters are all tall to help calculate the height required for text. */ TextUtils._measureString = "|\xc9q\xc5";
1951
+ // _heightMultiplier used to measure the height of text, but in miniprogram performance is different from h5.
1952
+ // so can set _heightMultiplier to adapt miniprogram, the larger the value, the worse the performance.
1953
+ /** @internal */ TextUtils._heightMultiplier = 2;
1952
1954
  })();
1953
1955
  (function() {
1954
- TextUtils._measureBaseline = "M";
1956
+ /** These characters are all tall to help calculate the height required for text. */ TextUtils._measureString = "|\xc9q\xc5";
1955
1957
  })();
1956
1958
  (function() {
1957
- TextUtils._heightMultiplier = 2;
1959
+ TextUtils._measureBaseline = "M";
1958
1960
  })();
1959
1961
  (function() {
1960
1962
  TextUtils._baselineMultiplier = 1.4;
@@ -2038,7 +2040,7 @@ var Logger = {
2038
2040
  var _this = this, engine = _this._engine;
2039
2041
  var fontAtlas = new FontAtlas(engine);
2040
2042
  var texture = new Texture2D(engine, 256, 256, exports.TextureFormat.R8G8B8A8, false);
2041
- texture.filterMode = exports.TextureFilterMode.Point;
2043
+ texture.filterMode = exports.TextureFilterMode.Bilinear;
2042
2044
  fontAtlas.texture = texture;
2043
2045
  fontAtlas.isGCIgnored = texture.isGCIgnored = true;
2044
2046
  this._fontAtlases.push(fontAtlas);
@@ -18703,7 +18705,7 @@ var /**
18703
18705
  var left = startX * pixelsPerUnitReciprocal;
18704
18706
  var right = (startX + w) * pixelsPerUnitReciprocal;
18705
18707
  var top = (startY + ascent) * pixelsPerUnitReciprocal;
18706
- var bottom = (startY - descent + 1) * pixelsPerUnitReciprocal;
18708
+ var bottom = (startY - descent) * pixelsPerUnitReciprocal;
18707
18709
  localPositions.set(left, top, right, bottom);
18708
18710
  i === firstLine && (maxY = Math.max(maxY, top));
18709
18711
  minY = Math.min(minY, bottom);
package/dist/module.js CHANGED
@@ -1943,13 +1943,15 @@ var Logger = {
1943
1943
  ];
1944
1944
  })();
1945
1945
  (function() {
1946
- /** These characters are all tall to help calculate the height required for text. */ TextUtils._measureString = "|\xc9q\xc5";
1946
+ // _heightMultiplier used to measure the height of text, but in miniprogram performance is different from h5.
1947
+ // so can set _heightMultiplier to adapt miniprogram, the larger the value, the worse the performance.
1948
+ /** @internal */ TextUtils._heightMultiplier = 2;
1947
1949
  })();
1948
1950
  (function() {
1949
- TextUtils._measureBaseline = "M";
1951
+ /** These characters are all tall to help calculate the height required for text. */ TextUtils._measureString = "|\xc9q\xc5";
1950
1952
  })();
1951
1953
  (function() {
1952
- TextUtils._heightMultiplier = 2;
1954
+ TextUtils._measureBaseline = "M";
1953
1955
  })();
1954
1956
  (function() {
1955
1957
  TextUtils._baselineMultiplier = 1.4;
@@ -2033,7 +2035,7 @@ var Logger = {
2033
2035
  var _this = this, engine = _this._engine;
2034
2036
  var fontAtlas = new FontAtlas(engine);
2035
2037
  var texture = new Texture2D(engine, 256, 256, TextureFormat.R8G8B8A8, false);
2036
- texture.filterMode = TextureFilterMode.Point;
2038
+ texture.filterMode = TextureFilterMode.Bilinear;
2037
2039
  fontAtlas.texture = texture;
2038
2040
  fontAtlas.isGCIgnored = texture.isGCIgnored = true;
2039
2041
  this._fontAtlases.push(fontAtlas);
@@ -18698,7 +18700,7 @@ var /**
18698
18700
  var left = startX * pixelsPerUnitReciprocal;
18699
18701
  var right = (startX + w) * pixelsPerUnitReciprocal;
18700
18702
  var top = (startY + ascent) * pixelsPerUnitReciprocal;
18701
- var bottom = (startY - descent + 1) * pixelsPerUnitReciprocal;
18703
+ var bottom = (startY - descent) * pixelsPerUnitReciprocal;
18702
18704
  localPositions.set(left, top, right, bottom);
18703
18705
  i === firstLine && (maxY = Math.max(maxY, top));
18704
18706
  minY = Math.min(minY, bottom);