@leafer-ui/image 1.12.1 → 1.12.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": "1.12.1",
3
+ "version": "1.12.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": "1.12.1",
26
- "@leafer-ui/draw": "1.12.1"
25
+ "@leafer/core": "1.12.3",
26
+ "@leafer-ui/draw": "1.12.3"
27
27
  },
28
28
  "devDependencies": {
29
- "@leafer/interface": "1.12.1",
30
- "@leafer-ui/interface": "1.12.1"
29
+ "@leafer/interface": "1.12.3",
30
+ "@leafer-ui/interface": "1.12.3"
31
31
  }
32
32
  }
package/src/image.ts CHANGED
@@ -65,7 +65,8 @@ export function image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds:
65
65
  ignoreRender(ui, false)
66
66
  onLoadError(ui, event, error)
67
67
  leafPaint.loadId = undefined
68
- }
68
+ },
69
+ paint.lod && image.getThumbSize()
69
70
  )
70
71
 
71
72
  if (ui.placeholderColor) {
@@ -78,8 +79,6 @@ export function image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds:
78
79
  }, ui.placeholderDelay)
79
80
  }
80
81
 
81
-
82
-
83
82
  }
84
83
 
85
84
  return leafPaint
package/src/pattern.ts CHANGED
@@ -11,10 +11,12 @@ const { getFloorScale } = MathHelper, { abs } = Math
11
11
  export function createPatternTask(paint: ILeafPaint, ui: IUI, canvas: ILeaferCanvas, renderOptions: IRenderOptions): void {
12
12
  if (!paint.patternTask) {
13
13
  paint.patternTask = ImageManager.patternTasker.add(async () => {
14
- paint.patternTask = null
15
- if (canvas.bounds.hit(ui.__nowWorld)) PaintImage.createPattern(paint, ui, canvas, renderOptions)
14
+ PaintImage.createPattern(paint, ui, canvas, renderOptions)
16
15
  ui.forceUpdate('surface')
17
- }, 300)
16
+ }, 0, () => {
17
+ paint.patternTask = null
18
+ return canvas.bounds.hit(ui.__nowWorld)
19
+ })
18
20
  }
19
21
  }
20
22