@tarojs/plugin-platform-harmony-ets 4.0.0-beta.47 → 4.0.0-beta.48

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.
@@ -62,7 +62,6 @@ let displayWidth = display.width
62
62
  let ratioCache: number | false = false
63
63
  let designWidthFunc: (input: number) => number
64
64
  let designWidth = defaultDesignWidth
65
- let deviceRatio = defaultDesignRatio
66
65
  function getRatio (value: number) {
67
66
  // Note: 提前调用 display 可能无法获取正确值
68
67
  if (ratioCache === false || displayWidth !== display.width) {
@@ -72,10 +71,6 @@ function getRatio (value: number) {
72
71
  ? config.designWidth
73
72
  : () => config.designWidth
74
73
  designWidth = designWidthFunc(value) || defaultDesignWidth
75
- deviceRatio = config.deviceRatio || defaultDesignRatio
76
- if (!(designWidth in deviceRatio)) {
77
- throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`)
78
- }
79
74
  }
80
75
  displayWidth = display.width
81
76
  ratioCache = Math.min(display.width, display.height) / designWidth
@@ -65,13 +65,10 @@ export default struct TaroIcon {
65
65
  Image(getIconData(this.node))
66
66
  .objectFit(ImageFit.Contain)
67
67
  .fillColor(this.node._attrs.color || ICON_COLOR_MAP[this.node._attrs.type] || Color.Black)
68
- .attributeModifier(commonStyleModify.setNode(this.node, {
69
- width: convertNumber2PX(23),
70
- height: convertNumber2PX(23)
71
- }).setAnimationStyle(this.overwriteStyle))
68
+ .attributeModifier(commonStyleModify.setNode(this.node).setAnimationStyle(this.overwriteStyle))
72
69
  .size({
73
- width: convertNumber2VP(Number(this.node._attrs.size) || 23),
74
- height: convertNumber2VP(Number(this.node._attrs.size) || 23),
70
+ width: Number(this.node._attrs.size) || 23,
71
+ height: Number(this.node._attrs.size) || 23
75
72
  })
76
73
  .onComplete(e => eventHandler(e, 'complete', this.node))
77
74
  .onClick(shouldBindEvent((e: ClickEvent) => eventHandler(e, 'click', this.node), this.node, ['click']))
@@ -4883,7 +4883,6 @@ let displayWidth = display.width;
4883
4883
  let ratioCache = false;
4884
4884
  let designWidthFunc;
4885
4885
  let designWidth = defaultDesignWidth;
4886
- let deviceRatio = defaultDesignRatio;
4887
4886
  function getRatio(value) {
4888
4887
  var _a;
4889
4888
  // Note: 提前调用 display 可能无法获取正确值
@@ -4894,10 +4893,6 @@ function getRatio(value) {
4894
4893
  ? config.designWidth
4895
4894
  : () => config.designWidth;
4896
4895
  designWidth = designWidthFunc(value) || defaultDesignWidth;
4897
- deviceRatio = config.deviceRatio || defaultDesignRatio;
4898
- if (!(designWidth in deviceRatio)) {
4899
- throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`);
4900
- }
4901
4896
  }
4902
4897
  displayWidth = display.width;
4903
4898
  ratioCache = Math.min(display.width, display.height) / designWidth;