@leafer-ui/image 2.1.4 → 2.1.5

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 +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-ui/image",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
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.4",
26
- "@leafer-ui/draw": "2.1.4"
25
+ "@leafer/core": "2.1.5",
26
+ "@leafer-ui/draw": "2.1.5"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "2.1.4",
30
- "@leafer-ui/interface": "2.1.4"
29
+ "@leafer/interface": "2.1.5",
30
+ "@leafer-ui/interface": "2.1.5"
31
31
  }
32
32
  }
package/src/image.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { IBoundsData, IImageEvent, ILeaferImage, IObject } from '@leafer/interface'
2
2
  import { Bounds, BoundsHelper, ImageEvent, ImageManager, LeafHelper } from '@leafer/core'
3
3
 
4
- import { IUI, IImagePaint, ILeafPaint } from '@leafer-ui/interface'
4
+ import { IUI, IImagePaint, ILeafPaint, IPaintAttr } from '@leafer-ui/interface'
5
5
  import { PaintImage } from "@leafer-ui/draw"
6
6
 
7
7
 
@@ -14,7 +14,7 @@ interface IImagePaintCache {
14
14
  let cache: IImagePaintCache, box = new Bounds()
15
15
  const { isSame } = BoundsHelper
16
16
 
17
- export function image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint {
17
+ export function image(ui: IUI, attrName: IPaintAttr, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint {
18
18
  let leafPaint: ILeafPaint, event: IImageEvent
19
19
  const image = ImageManager.get(paint, paint.type)
20
20
 
@@ -85,7 +85,7 @@ export function image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds:
85
85
  }
86
86
 
87
87
 
88
- function checkSizeAndCreateData(ui: IUI, attrName: string, paint: IImagePaint, image: ILeaferImage, leafPaint: ILeafPaint, boxBounds: IBoundsData): boolean {
88
+ function checkSizeAndCreateData(ui: IUI, attrName: IPaintAttr, paint: IImagePaint, image: ILeaferImage, leafPaint: ILeafPaint, boxBounds: IBoundsData): boolean {
89
89
  let needUpdate = true
90
90
  const data = ui.__
91
91
 
@@ -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, ui)
106
+ if (paint.mode === 'brush') PaintImage.brush(leafPaint, ui, attrName)
107
107
 
108
108
  if (!leafPaint.data) {
109
109
  PaintImage.createData(leafPaint, image, paint, boxBounds)