From 2ac176e36b43ca260ce0f4129f0b2f225b744fb5 Mon Sep 17 00:00:00 2001 From: Donghyeon Kim Date: Mon, 25 May 2026 15:21:47 +0900 Subject: [PATCH] fix(candlestick): apply canvas-level clipPath in normal rendering mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 작업 배경 - CandlestickView normal mode에서 clip:true 설정 시에도 canvas-level clipPath가 적용되지 않아 multi-grid 레이아웃에서 candlestick wick이 인접 grid 영역으로 침범하는 버그 ## 작업 내용 - _renderNormal()에서 clip:true일 때 group.setClipPath() 적용 (LineView와 동일한 방식) - render()에서 무조건 호출하던 group.removeClipPath() 제거 — _renderNormal과 _renderLarge 각각에서 clip 상태에 따라 처리 - 기존 per-item isNormalBoxClipped 검사는 최적화로 유지 (전체 영역 밖 item skip) Fixes apache#21627 --- src/chart/candlestick/CandlestickView.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/chart/candlestick/CandlestickView.ts b/src/chart/candlestick/CandlestickView.ts index 3d05e81c70..38e0f26176 100644 --- a/src/chart/candlestick/CandlestickView.ts +++ b/src/chart/candlestick/CandlestickView.ts @@ -48,8 +48,6 @@ class CandlestickView extends ChartView { private _progressiveEls: Element[]; render(seriesModel: CandlestickSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) { - // If there is clipPath created in large mode. Remove it. - this.group.removeClipPath(); // Clear previously rendered progressive elements. this._progressiveEls = null; @@ -164,6 +162,16 @@ class CandlestickView extends ChartView { .execute(); this._data = data; + + if (needsClip) { + const clipPath = createClipPath(coord, false, seriesModel); + if (clipPath) { + group.setClipPath(clipPath); + } + } + else { + group.removeClipPath(); + } } _renderLarge(seriesModel: CandlestickSeriesModel) {