You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@leafer/renderer

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafer/renderer - npm Package Compare versions

Comparing version
1.6.0
to
1.6.1
+3
-3
package.json
{
"name": "@leafer/renderer",
"version": "1.6.0",
"version": "1.6.1",
"description": "@leafer/renderer",

@@ -25,7 +25,7 @@ "author": "Chao (Leafer) Wan",

"dependencies": {
"@leafer/core": "1.6.0"
"@leafer/core": "1.6.1"
},
"devDependencies": {
"@leafer/interface": "1.6.0"
"@leafer/interface": "1.6.1"
}
}

@@ -67,2 +67,12 @@ import { ILeaf, ILeaferBase, ILeaferCanvas, IRenderer, IRendererConfig, IEventListenerId, IBounds, IFunction, IRenderOptions } from '@leafer/interface'

if (this.running) {
const { target } = this
if (target.isApp) {
target.emit(RenderEvent.CHILD_START, target);
(target.children as ILeaferBase[]).forEach(leafer => {
leafer.renderer.FPS = this.FPS
leafer.renderer.checkRender()
})
target.emit(RenderEvent.CHILD_END, target)
}
if (this.changed && this.canvas.view) this.render()

@@ -166,3 +176,3 @@ this.target.emit(RenderEvent.NEXT)

this.__render(bounds, block.includes(this.target.__world), realBounds)
this.__render(bounds, realBounds)
canvas.restore()

@@ -179,3 +189,3 @@

canvas.clear()
this.__render(canvas.bounds, true)
this.__render(canvas.bounds)
canvas.restore()

@@ -186,4 +196,4 @@

protected __render(bounds: IBounds, includes?: boolean, realBounds?: IBounds,): void {
const { canvas } = this, options: IRenderOptions = includes ? { includes } : { bounds, includes }
protected __render(bounds: IBounds, realBounds?: IBounds): void {
const { canvas } = this, includes = bounds.includes(this.target.__world), options: IRenderOptions = includes ? { includes } : { bounds, includes }

@@ -219,4 +229,4 @@ if (this.needFill) canvas.fillWorld(bounds, this.config.fill)

const target = this.target as ILeaferBase
if (target.parentApp) return target.parentApp.renderer.update(false) // App 模式下统一走 app 控制渲染帧
if (this.requestTime) return
if (this.requestTime || !target) return
if (target.parentApp) return target.parentApp.requestRender(false) // App 模式下统一走 app 控制渲染帧

@@ -229,11 +239,2 @@ const requestTime = this.requestTime = Date.now()

if (target.isApp) {
target.emit(RenderEvent.CHILD_START, target);
(target.children as ILeaferBase[]).forEach(leafer => {
leafer.renderer.FPS = this.FPS
leafer.renderer.checkRender()
})
target.emit(RenderEvent.CHILD_END, target)
}
this.checkRender()

@@ -240,0 +241,0 @@

@@ -36,3 +36,3 @@ import { IRenderer, ILeaf, ILeaferCanvas, IBounds, IRendererConfig, IRenderOptions, IEventListenerId, IFunction } from '@leafer/interface';

fullRender(): void;
protected __render(bounds: IBounds, includes?: boolean, realBounds?: IBounds): void;
protected __render(bounds: IBounds, realBounds?: IBounds): void;
addBlock(block: IBounds): void;

@@ -39,0 +39,0 @@ mergeBlocks(): void;