From 0cdc54da27e3e88d65f98c813f13d48f6759ce97 Mon Sep 17 00:00:00 2001 From: Macbook Date: Tue, 2 Jun 2026 11:47:43 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=BC=EB=AA=A9=EA=B7=A0=ED=98=95=ED=91=9C?= =?UTF-8?q?=20=EA=B5=AC=EB=A6=84=20draw=20=EB=A3=A8=ED=94=84=20=EB=94=94?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EB=A1=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- frontend/src/utils/IchimokuCloudPlugin.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/utils/IchimokuCloudPlugin.ts b/frontend/src/utils/IchimokuCloudPlugin.ts index 09d26bb..3c96890 100644 --- a/frontend/src/utils/IchimokuCloudPlugin.ts +++ b/frontend/src/utils/IchimokuCloudPlugin.ts @@ -70,30 +70,31 @@ class CloudRenderer implements IPrimitivePaneRenderer { console.log('[IchimokuCloud] draw: skipped, data.length=', this._data.length); return; } - console.log('[IchimokuCloud] draw called. data.length:', this._data.length, 'bullish:', this._bullishVisible, 'bearish:', this._bearishVisible); const timeScale = this._chart.timeScale(); // eslint-disable-next-line @typescript-eslint/no-explicit-any target.useBitmapCoordinateSpace(({ context: ctx, horizontalPixelRatio: hpr, verticalPixelRatio: vpr }: any) => { + let drawn = 0, skippedTime = 0, skippedPrice = 0; for (let i = 0; i < this._data.length - 1; i++) { const a = this._data[i]; const b = this._data[i + 1]; const x1 = timeScale.timeToCoordinate(a.time as Time); const x2 = timeScale.timeToCoordinate(b.time as Time); - if (x1 == null || x2 == null) continue; + if (x1 == null || x2 == null) { skippedTime++; continue; } const aAy = this._series.priceToCoordinate(a.spanA); const aBy = this._series.priceToCoordinate(a.spanB); const bAy = this._series.priceToCoordinate(b.spanA); const bBy = this._series.priceToCoordinate(b.spanB); - if (aAy == null || aBy == null || bAy == null || bBy == null) continue; + if (aAy == null || aBy == null || bAy == null || bBy == null) { skippedPrice++; continue; } // 한국 관례: SpanA > SpanB → 양운(빨강), SpanA <= SpanB → 음운(청록) const bullish = (a.spanA + b.spanA) > (a.spanB + b.spanB); if (bullish && !this._bullishVisible) continue; if (!bullish && !this._bearishVisible) continue; + drawn++; ctx.save(); ctx.beginPath(); ctx.moveTo(x1 * hpr, aAy * vpr); @@ -105,6 +106,11 @@ class CloudRenderer implements IPrimitivePaneRenderer { ctx.fill(); ctx.restore(); } + if (skippedTime > 0 || skippedPrice > 0 || drawn === 0) { + console.warn('[IchimokuCloud] draw result: drawn=', drawn, 'skippedTime=', skippedTime, 'skippedPrice=', skippedPrice, + 'sample time0=', this._data[0]?.time, 'x1_0=', timeScale.timeToCoordinate(this._data[0]?.time as Time), + 'spanA0=', this._data[0]?.spanA, 'priceCoord=', this._series.priceToCoordinate(this._data[0]?.spanA)); + } }); } }