@lightningtv/core
Advanced tools
Comparing version 2.2.4 to 2.2.5
@@ -30,6 +30,4 @@ import { renderer, createShader } from './lightningInit.js'; | ||
const effects = []; | ||
let index = 0; | ||
for (const [type, props] of Object.entries(styleEffects)) { | ||
effects.push({ name: `effect${index}`, type, props }); | ||
index++; | ||
effects.push({ type, props }); | ||
} | ||
@@ -138,3 +136,4 @@ return createShader('DynamicShader', { effects }); | ||
if (this.rendered) { | ||
this.shader = convertEffectsToShader(v); | ||
v._shader = v._shader || convertEffectsToShader(v); | ||
this.shader = v._shader; | ||
} | ||
@@ -521,3 +520,14 @@ } | ||
if (node._effects) { | ||
props.shader = convertEffectsToShader(node._effects); | ||
let shader; | ||
// states can change effects so don't use cached shader | ||
if (node.style?.effects && !this._states) { | ||
const effects = node.style.effects; | ||
effects._shader = | ||
effects._shader || convertEffectsToShader(node._effects); | ||
shader = effects._shader; | ||
} | ||
else { | ||
shader = convertEffectsToShader(node._effects); | ||
} | ||
props.shader = shader; | ||
} | ||
@@ -524,0 +534,0 @@ if (isElementText(node)) { |
@@ -1,2 +0,2 @@ | ||
import { type FadeOutEffectProps, type GlitchEffectProps, type GrayscaleEffectProps, type AnimationSettings as RendererAnimationSettings, type LinearGradientEffectProps, type RadialGradientEffectProps, type RadialProgressEffectProps, type ITextNodeProps } from '@lightningjs/renderer'; | ||
import { type FadeOutEffectProps, type GlitchEffectProps, type GrayscaleEffectProps, type AnimationSettings as RendererAnimationSettings, type LinearGradientEffectProps, type RadialGradientEffectProps, type RadialProgressEffectProps, type ITextNodeProps, type ShaderController, type HolePunchEffectProps } from '@lightningjs/renderer'; | ||
import { ElementNode, type RendererNode } from './elementNode.js'; | ||
@@ -22,3 +22,4 @@ import { NodeStates } from './states.js'; | ||
radialProgress?: RadialProgressEffectProps; | ||
holePunch?: any; | ||
holePunch?: HolePunchEffectProps; | ||
_shader?: ShaderController<'DynamicShader'>; | ||
} | ||
@@ -25,0 +26,0 @@ export interface BorderEffects { |
{ | ||
"name": "@lightningtv/core", | ||
"version": "2.2.4", | ||
"version": "2.2.5", | ||
"description": "Lightning TV Core for Universal Renderers", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -74,7 +74,5 @@ import { renderer, createShader } from './lightningInit.js'; | ||
const effects: EffectDescUnion[] = []; | ||
let index = 0; | ||
for (const [type, props] of Object.entries(styleEffects)) { | ||
effects.push({ name: `effect${index}`, type, props } as EffectDescUnion); | ||
index++; | ||
effects.push({ type, props } as EffectDescUnion); | ||
} | ||
@@ -288,3 +286,4 @@ return createShader('DynamicShader', { effects }); | ||
if (this.rendered) { | ||
this.shader = convertEffectsToShader(v); | ||
v._shader = v._shader || convertEffectsToShader(v); | ||
this.shader = v._shader; | ||
} | ||
@@ -755,3 +754,13 @@ } | ||
if (node._effects) { | ||
props.shader = convertEffectsToShader(node._effects); | ||
let shader; | ||
// states can change effects so don't use cached shader | ||
if (node.style?.effects && !this._states) { | ||
const effects = node.style.effects; | ||
effects._shader = | ||
effects._shader || convertEffectsToShader(node._effects); | ||
shader = effects._shader; | ||
} else { | ||
shader = convertEffectsToShader(node._effects); | ||
} | ||
props.shader = shader; | ||
} | ||
@@ -758,0 +767,0 @@ |
@@ -10,2 +10,4 @@ import { | ||
type ITextNodeProps, | ||
type ShaderController, | ||
type HolePunchEffectProps, | ||
} from '@lightningjs/renderer'; | ||
@@ -37,3 +39,4 @@ import { ElementNode, type RendererNode } from './elementNode.js'; | ||
radialProgress?: RadialProgressEffectProps; | ||
holePunch?: any; // shoud be HolePunchEffectProps; | ||
holePunch?: HolePunchEffectProps; | ||
_shader?: ShaderController<'DynamicShader'>; | ||
} | ||
@@ -40,0 +43,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
219665
3343