mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 10:08:34 +00:00
fix: draw last frame at @idraw/render
This commit is contained in:
parent
c831a19d6c
commit
edaf29b144
2 changed files with 8 additions and 4 deletions
|
|
@ -98,6 +98,7 @@ class Core {
|
|||
scrollX: transfrom.scrollX,
|
||||
scrollY: transfrom.scrollY,
|
||||
});
|
||||
this[_renderer].thaw();
|
||||
this[_renderer].render(this[_board].getContext(), this[_data], {
|
||||
changeResourceUUIDs: opts?.resourceChangeUUIDs || []
|
||||
});
|
||||
|
|
|
|||
|
|
@ -116,14 +116,14 @@ export default class Renderer extends RendererEvent {
|
|||
return this[_ctx]
|
||||
}
|
||||
|
||||
thaw() {
|
||||
this[_status] = DrawStatus.FREE;
|
||||
}
|
||||
|
||||
private [_freeze]() {
|
||||
this[_status] = DrawStatus.FREEZE;
|
||||
}
|
||||
|
||||
// private _thaw() {
|
||||
// this[_status] = DrawStatus.FREE;
|
||||
// }
|
||||
|
||||
private [_drawFrame]() {
|
||||
if (this[_status] === DrawStatus.FREEZE) {
|
||||
return;
|
||||
|
|
@ -164,6 +164,9 @@ export default class Renderer extends RendererEvent {
|
|||
this.trigger('drawFrame', { t: Date.now() })
|
||||
|
||||
if (this[_loader].isComplete() === true && this[_queue].length === 1 && this[_status] === DrawStatus.FREE) {
|
||||
if (ctx && this[_queue][0] && this[_queue][0].data) {
|
||||
drawContext(ctx, this[_queue][0].data, this[_loader]);
|
||||
}
|
||||
this.trigger('drawFrameComplete', { t: Date.now() });
|
||||
this[_freeze]();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue