@leafer-ui/image 2.1.1 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/image",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
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.1",
26
- "@leafer-ui/draw": "2.1.1"
25
+ "@leafer/core": "2.1.3",
26
+ "@leafer-ui/draw": "2.1.3"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "2.1.1",
30
- "@leafer-ui/interface": "2.1.1"
29
+ "@leafer/interface": "2.1.3",
30
+ "@leafer-ui/interface": "2.1.3"
31
31
  }
32
32
  }
package/src/image.ts CHANGED
@@ -103,7 +103,7 @@ function checkSizeAndCreateData(ui: IUI, attrName: string, paint: IImagePaint, i
103
103
  }
104
104
  }
105
105
 
106
- if (paint.mode === 'brush') PaintImage.brush(leafPaint)
106
+ if (paint.mode === 'brush') PaintImage.brush(leafPaint, ui)
107
107
 
108
108
  if (!leafPaint.data) {
109
109
  PaintImage.createData(leafPaint, image, paint, boxBounds)
package/src/pattern.ts CHANGED
@@ -54,9 +54,14 @@ export function createPattern(paint: ILeafPaint, ui: IUI, canvas: ILeaferCanvas,
54
54
  }
55
55
 
56
56
  const imageCanvas = image.getCanvas(width, height, opacity, undefined, xGap, yGap, ui.leafer && ui.leafer.config.smooth, data.interlace)
57
- const pattern = brush ? imageCanvas : image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint)
58
57
 
59
- paint.style = pattern
58
+ if (brush) {
59
+ paint.style = imageCanvas
60
+ PaintImage.cacheBrush(paint, ui, canvas, renderOptions)
61
+ } else {
62
+ paint.style = image.getPattern(imageCanvas, data.repeat || (Platform.origin.noRepeat || 'no-repeat'), imageMatrix, paint)
63
+ }
64
+
60
65
  paint.patternId = id
61
66
 
62
67
  }