@leafer-ui/display 1.0.0-rc.27 → 1.0.0-rc.28
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 +8 -8
- package/src/Canvas.ts +1 -1
- package/src/Group.ts +1 -1
- package/src/Leafer.ts +7 -4
- package/src/UI.ts +1 -1
- package/types/index.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/display",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.28",
|
|
4
4
|
"description": "@leafer-ui/display",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.0.0-rc.
|
|
26
|
-
"@leafer-ui/data": "1.0.0-rc.
|
|
27
|
-
"@leafer-ui/display-module": "1.0.0-rc.
|
|
28
|
-
"@leafer-ui/decorator": "1.0.0-rc.
|
|
29
|
-
"@leafer-ui/external": "1.0.0-rc.
|
|
25
|
+
"@leafer/core": "1.0.0-rc.28",
|
|
26
|
+
"@leafer-ui/data": "1.0.0-rc.28",
|
|
27
|
+
"@leafer-ui/display-module": "1.0.0-rc.28",
|
|
28
|
+
"@leafer-ui/decorator": "1.0.0-rc.28",
|
|
29
|
+
"@leafer-ui/external": "1.0.0-rc.28"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@leafer/interface": "1.0.0-rc.
|
|
33
|
-
"@leafer-ui/interface": "1.0.0-rc.
|
|
32
|
+
"@leafer/interface": "1.0.0-rc.28",
|
|
33
|
+
"@leafer-ui/interface": "1.0.0-rc.28"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/Canvas.ts
CHANGED
|
@@ -64,7 +64,7 @@ export class Canvas extends Rect implements ICanvas {
|
|
|
64
64
|
public __drawAfterFill(canvas: ILeaferCanvas, _options: IRenderOptions): void {
|
|
65
65
|
const origin = this.canvas.view as ISizeData
|
|
66
66
|
const { width, height } = this
|
|
67
|
-
if (this.__.cornerRadius) {
|
|
67
|
+
if (this.__.cornerRadius || this.pathInputed) {
|
|
68
68
|
canvas.save()
|
|
69
69
|
canvas.clip()
|
|
70
70
|
canvas.drawImage(this.canvas.view as any, 0, 0, origin.width, origin.height, 0, 0, width, height)
|
package/src/Group.ts
CHANGED
|
@@ -84,7 +84,7 @@ export class Group extends UI implements IGroup { // tip: rewrited Box
|
|
|
84
84
|
this.add(child, this.children.indexOf(after) + 1)
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
public addBefore(child:
|
|
87
|
+
public addBefore(child: IUI, before: IUI): void {
|
|
88
88
|
this.add(child, this.children.indexOf(before))
|
|
89
89
|
}
|
|
90
90
|
|
package/src/Leafer.ts
CHANGED
|
@@ -196,7 +196,7 @@ export class Leafer extends Group implements ILeafer {
|
|
|
196
196
|
Object.keys(data).forEach(key => (this as any)[key] = data[key])
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
override forceRender(bounds?: IBoundsData): void {
|
|
200
200
|
this.renderer.addBlock(bounds ? new Bounds(bounds) : this.canvas.bounds)
|
|
201
201
|
if (this.viewReady) this.renderer.update()
|
|
202
202
|
}
|
|
@@ -247,7 +247,7 @@ export class Leafer extends Group implements ILeafer {
|
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
|
|
250
|
+
override __setAttr(attrName: string, newValue: IValue): boolean {
|
|
251
251
|
if (this.canvas) {
|
|
252
252
|
if (canvasSizeAttrs.includes(attrName)) {
|
|
253
253
|
this.__changeCanvasSize(attrName, newValue as number)
|
|
@@ -255,12 +255,15 @@ export class Leafer extends Group implements ILeafer {
|
|
|
255
255
|
this.__changeFill(newValue as string)
|
|
256
256
|
} else if (attrName === 'hittable') {
|
|
257
257
|
if (!this.parent) this.canvas.hittable = newValue as boolean
|
|
258
|
+
} else if (attrName === 'zIndex') {
|
|
259
|
+
this.canvas.zIndex = newValue as any
|
|
260
|
+
setTimeout(() => this.parent && this.parent.__updateSortChildren())
|
|
258
261
|
}
|
|
259
262
|
}
|
|
260
263
|
return super.__setAttr(attrName, newValue)
|
|
261
264
|
}
|
|
262
265
|
|
|
263
|
-
|
|
266
|
+
override __getAttr(attrName: string): IValue {
|
|
264
267
|
if (this.canvas && canvasSizeAttrs.includes(attrName)) return this.canvas[attrName]
|
|
265
268
|
return super.__getAttr(attrName)
|
|
266
269
|
}
|
|
@@ -404,7 +407,7 @@ export class Leafer extends Group implements ILeafer {
|
|
|
404
407
|
this.__eventIds.length = 0
|
|
405
408
|
}
|
|
406
409
|
|
|
407
|
-
|
|
410
|
+
override destroy(sync?: boolean): void {
|
|
408
411
|
const doDestory = () => {
|
|
409
412
|
if (!this.destroyed) {
|
|
410
413
|
Leafer.list.remove(this)
|
package/src/UI.ts
CHANGED
|
@@ -416,7 +416,7 @@ export class UI extends Leaf implements IUI { // tip: rewrited Box
|
|
|
416
416
|
public __onUpdateSize(): void {
|
|
417
417
|
if (this.__.__input) {
|
|
418
418
|
const data = this.__;
|
|
419
|
-
(data.lazy && this.
|
|
419
|
+
(data.lazy && !this.__inLazyBounds && !Export.running) ? data.__needComputePaint = true : data.__computePaint()
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
|
package/types/index.d.ts
CHANGED
|
@@ -142,7 +142,7 @@ declare class Group extends UI implements IGroup {
|
|
|
142
142
|
pick(_hitPoint: IPointData, _options?: IPickOptions): IPickResult;
|
|
143
143
|
addAt(child: IUI, index: number): void;
|
|
144
144
|
addAfter(child: IUI, after: IUI): void;
|
|
145
|
-
addBefore(child:
|
|
145
|
+
addBefore(child: IUI, before: IUI): void;
|
|
146
146
|
add(_child: IUI, _index?: number): void;
|
|
147
147
|
addMany(..._children: IUI[]): void;
|
|
148
148
|
remove(_child?: IUI, _destroy?: boolean): void;
|