Skip to content

Commit b60e695

Browse files
authored
Merge pull request #1930 from drunksweet/develop
fix: fix disappear animation paticle miss the props of useWebGL
2 parents 4941e2e + c5cab71 commit b60e695

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/vrender-animate/src/custom/disappear/base/CustomEffectBase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class HybridEffectBase extends DisappearAnimateBase {
9494
let result: HTMLCanvasElement | null = null;
9595

9696
// 根据用户配置决定渲染策略
97-
if (this.params?.options?.useWebGL) {
97+
if (this.params?.options?.useWebGL !== false) {
9898
// 用户允许使用WebGL,按照父类的自动判别逻辑
9999
// 优先尝试WebGL实现
100100
if (this.supportsWebGL()) {

packages/vrender-animate/src/custom/disappear/particle.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface ParticleConfig {
77
count?: number; // 粒子数量
88
size?: number; // 粒子大小
99
strength?: number; // 力场强度
10+
useWebGL: boolean;
1011
}
1112
// 粒子数据结构
1213
export interface ParticleData {
@@ -41,7 +42,8 @@ export class Particle extends HybridEffectBase {
4142
effectType: params?.options?.effectType || 'gravity', //'explode' | 'vortex' | 'gravity'; // 粒子效果类型
4243
count: params?.options?.count || 4000,
4344
size: params?.options?.size || 20,
44-
strength: params?.options?.strength || 1.5
45+
strength: params?.options?.strength || 1.5,
46+
useWebGL: params?.options?.useWebGL !== undefined ? params.options.useWebGL : true // 是否使用WebGL实现
4547
};
4648
}
4749

0 commit comments

Comments
 (0)