From e3bcf4235d3ed11d5761337f219be437c3b01fdf Mon Sep 17 00:00:00 2001 From: Macbook Date: Tue, 2 Jun 2026 12:30:23 +0900 Subject: [PATCH] =?UTF-8?q?=EB=94=94=EB=B2=84=EA=B7=B8:=20cloud=20fill=20?= =?UTF-8?q?=EC=A2=8C=ED=91=9C=20=EB=B0=8F=20=EC=83=89=EC=83=81=20=EB=A1=9C?= =?UTF-8?q?=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 | 25 +++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/frontend/src/utils/IchimokuCloudPlugin.ts b/frontend/src/utils/IchimokuCloudPlugin.ts index b2c192f..a6da9ee 100644 --- a/frontend/src/utils/IchimokuCloudPlugin.ts +++ b/frontend/src/utils/IchimokuCloudPlugin.ts @@ -71,11 +71,18 @@ class CloudRenderer implements IPrimitivePaneRenderer { // eslint-disable-next-line @typescript-eslint/no-explicit-any target.useBitmapCoordinateSpace(({ context: ctx, horizontalPixelRatio: hpr, verticalPixelRatio: vpr }: any) => { - // Z-ORDER TEST: 밝은 빨간 직사각형 - 보이면 z-order가 맞고, 안보이면 캔버스가 뒤에 있는것 - ctx.save(); - ctx.fillStyle = 'rgba(255, 0, 0, 0.8)'; - ctx.fillRect(100 * hpr, 50 * vpr, 300 * hpr, 80 * vpr); - ctx.restore(); + // 첫 번째 데이터 포인트 좌표 확인 + const d0 = this._data[0]; + const d1 = this._data[1]; + const tx0 = timeScale.timeToCoordinate(d0.time as Time); + const tx1 = timeScale.timeToCoordinate(d1.time as Time); + const ay0 = this._series.priceToCoordinate(d0.spanA); + const by0 = this._series.priceToCoordinate(d0.spanB); + console.log('[IchimokuCloud] coords: x0=', tx0, 'x1=', tx1, + 'spanA_price=', d0.spanA, 'spanA_y=', ay0, + 'spanB_price=', d0.spanB, 'spanB_y=', by0, + 'hpr=', hpr, 'vpr=', vpr, + 'canvas_w=', ctx.canvas?.width, 'canvas_h=', ctx.canvas?.height); let drawn = 0, skippedTime = 0, skippedPrice = 0; for (let i = 0; i < this._data.length - 1; i++) { @@ -92,7 +99,6 @@ class CloudRenderer implements IPrimitivePaneRenderer { const bBy = this._series.priceToCoordinate(b.spanB); 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; @@ -109,11 +115,8 @@ 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)); - } + console.log('[IchimokuCloud] drawn=', drawn, 'skippedTime=', skippedTime, 'skippedPrice=', skippedPrice, + 'bullishColor=', this._bullishColor, 'bearishColor=', this._bearishColor); }); } }