@leafer-ui/image 2.1.6 → 2.1.8

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/image.ts +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/image",
3
- "version": "2.1.6",
3
+ "version": "2.1.8",
4
4
  "description": "@leafer-ui/image",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/core": "2.1.6",
26
- "@leafer-ui/draw": "2.1.6"
25
+ "@leafer/core": "2.1.8",
26
+ "@leafer-ui/draw": "2.1.8"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "2.1.6",
30
- "@leafer-ui/interface": "2.1.6"
29
+ "@leafer/interface": "2.1.8",
30
+ "@leafer-ui/interface": "2.1.8"
31
31
  }
32
32
  }
package/src/image.ts CHANGED
@@ -94,7 +94,8 @@ function checkSizeAndCreateData(ui: IUI, attrName: IPaintAttr, paint: IImagePain
94
94
  data.__naturalHeight = image.height / data.pixelRatio
95
95
  if (data.__autoSide) {
96
96
  ui.forceUpdate('width')
97
- LeafHelper.updateBounds(ui) // 立即更新 boxBounds
97
+ LeafHelper.updateBounds(ui) // 立即更新 boxBounds,避免图片闪动
98
+ ui.__layout.boundsChanged = true // fix(flow): 仍需要标记,以通知父级更新 bounds
98
99
  if (ui.__proxyData) {
99
100
  ui.setProxyAttr('width', data.width)
100
101
  ui.setProxyAttr('height', data.height)
@@ -103,7 +104,7 @@ function checkSizeAndCreateData(ui: IUI, attrName: IPaintAttr, paint: IImagePain
103
104
  }
104
105
  }
105
106
 
106
- if (paint.mode === 'brush') PaintImage.brush(leafPaint, ui, attrName)
107
+ if (paint.mode === 'brush') PaintImage.brush(ui, attrName, leafPaint)
107
108
 
108
109
  if (!leafPaint.data) {
109
110
  PaintImage.createData(leafPaint, image, paint, boxBounds)