mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-02-28 17:37:07 +08:00
fix: transform引起一直更新 & 丰富注释
This commit is contained in:
parent
c6cbdae5d5
commit
3d1e0a45c3
@ -138,6 +138,9 @@ export class MotaOffscreenCanvas2D extends EventEmitter<OffscreenCanvasEvent> {
|
|||||||
MotaOffscreenCanvas2D.list.delete(this);
|
MotaOffscreenCanvas2D.list.delete(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 冻结这个画布的属性,之后便不能被修改,同时会从画布列表中删去。
|
||||||
|
*/
|
||||||
freeze() {
|
freeze() {
|
||||||
this._freezed = true;
|
this._freezed = true;
|
||||||
MotaOffscreenCanvas2D.list.delete(this);
|
MotaOffscreenCanvas2D.list.delete(this);
|
||||||
|
@ -22,7 +22,9 @@ export interface IRenderUpdater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface IRenderAnchor {
|
interface IRenderAnchor {
|
||||||
|
/** 锚点横坐标,0表示最左端,1表示最右端 */
|
||||||
anchorX: number;
|
anchorX: number;
|
||||||
|
/** 锚点纵坐标,0表示最上端,1表示最下端 */
|
||||||
anchorY: number;
|
anchorY: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,6 +55,7 @@ interface IRenderConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IRenderChildable {
|
export interface IRenderChildable {
|
||||||
|
/** 当前元素的子元素 */
|
||||||
children: Set<RenderItem>;
|
children: Set<RenderItem>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -312,7 +315,7 @@ export abstract class RenderItem<E extends ERenderItemEvent = ERenderItemEvent>
|
|||||||
if (this.hidden) return;
|
if (this.hidden) return;
|
||||||
this.emit('beforeRender', transform);
|
this.emit('beforeRender', transform);
|
||||||
this.needUpdate = false;
|
this.needUpdate = false;
|
||||||
const tran = this.transformFallThrough ? transform : this.transform;
|
const tran = this.transformFallThrough ? transform : this._transform;
|
||||||
|
|
||||||
const ax = -this.anchorX * this.width;
|
const ax = -this.anchorX * this.width;
|
||||||
const ay = -this.anchorY * this.height;
|
const ay = -this.anchorY * this.height;
|
||||||
|
Loading…
Reference in New Issue
Block a user