From 64a08bcc09d575a29136898ca838c376922a9b09 Mon Sep 17 00:00:00 2001 From: xiaoluoHe Date: Tue, 18 Jun 2024 11:39:40 +0800 Subject: [PATCH] fix: do not render when baseOpacity is invalid --- .../story/character/chart/graphic/vchart-graphic-render.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/vstory/src/story/character/chart/graphic/vchart-graphic-render.ts b/packages/vstory/src/story/character/chart/graphic/vchart-graphic-render.ts index 99a61ba7..7c0175bd 100644 --- a/packages/vstory/src/story/character/chart/graphic/vchart-graphic-render.ts +++ b/packages/vstory/src/story/character/chart/graphic/vchart-graphic-render.ts @@ -39,7 +39,10 @@ export class VChartRender extends DefaultCanvasRectRender implements IGraphicRen themeAttribute: IThemeAttribute ) => boolean ) { - const { baseOpacity = 1 } = chart.attribute; + let { baseOpacity = 1 } = chart.attribute; + if (baseOpacity <= 0) { + return; + } context.baseGlobalAlpha *= baseOpacity; super.drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb); context.baseGlobalAlpha /= baseOpacity;