gm-printer 10.42.3-beta.2 → 10.42.3-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-printer",
3
- "version": "10.42.3-beta.2",
3
+ "version": "10.42.3-beta.4",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -766,7 +766,10 @@ class EditorStore {
766
766
  }
767
767
  })
768
768
  break
769
- case 'image':
769
+ case 'image': {
770
+ // 有原始比例时按比例初始化高度,避免插入即变形;无 ratio(降级/旧链路)保持 100x100
771
+ const w = 100
772
+ const h = ratio ? Math.round(w / ratio) : w
770
773
  blocks.push({
771
774
  type: 'image',
772
775
  link: link,
@@ -776,11 +779,12 @@ class EditorStore {
776
779
  position: 'absolute',
777
780
  left: pos.left || '0px',
778
781
  top: pos.top || '0px',
779
- width: '100px',
780
- height: '100px'
782
+ width: w + 'px',
783
+ height: h + 'px'
781
784
  }
782
785
  })
783
786
  break
787
+ }
784
788
  case 'counter':
785
789
  blocks.push({
786
790
  type: 'counter',