디버그: cloud fill 좌표 및 색상 로그 추가

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Macbook
2026-06-02 12:30:23 +09:00
parent 77b714ef8e
commit e3bcf4235d
+14 -11
View File
@@ -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);
});
}
}