From cba7ff590a6867c76c58267676c01d1837364eb3 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 4 Feb 2026 21:31:52 -0800 Subject: [PATCH] =?UTF-8?q?fix(mining-app):=20K=E7=BA=BF=E8=9C=A1=E7=83=9B?= =?UTF-8?q?=E5=9B=BE=E6=9C=80=E5=B0=8F=E5=AE=9E=E4=BD=93=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E6=B6=88=E9=99=A4=E6=A8=AA=E7=BA=BF?= =?UTF-8?q?"-"=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题:销毁时段(无交易)的小时K线中,open ≈ close(价差仅 ~2.8e-10), 蜡烛实体映射到像素后高度接近0,旧代码强制最小1px导致显示为横线"-"。 修复:将蜡烛实体最小高度从固定1px改为 max(bodyWidth * 0.4, 3.0)px, 即至少为蜡烛宽度的40%或3像素(取较大值),使 doji 蜡烛显示为 可辨识的小方块而非横线。有正常涨跌幅的蜡烛不受影响。 Co-Authored-By: Claude Opus 4.5 --- .../lib/presentation/widgets/kline_chart/kline_painter.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/mining-app/lib/presentation/widgets/kline_chart/kline_painter.dart b/frontend/mining-app/lib/presentation/widgets/kline_chart/kline_painter.dart index 6858d1ea..ed89f0af 100644 --- a/frontend/mining-app/lib/presentation/widgets/kline_chart/kline_painter.dart +++ b/frontend/mining-app/lib/presentation/widgets/kline_chart/kline_painter.dart @@ -179,7 +179,9 @@ class KlinePainter extends CustomPainter { // 绘制实体 final bodyTop = math.min(yOpen, yClose); final bodyBottom = math.max(yOpen, yClose); - final actualBodyBottom = bodyBottom - bodyTop < 1 ? bodyTop + 1 : bodyBottom; + // 最小实体高度:至少为蜡烛宽度的40%或3像素,避免 open≈close 时显示为横线"-" + final minBodyHeight = math.max(bodyWidth * 0.4, 3.0); + final actualBodyBottom = bodyBottom - bodyTop < minBodyHeight ? bodyTop + minBodyHeight : bodyBottom; if (isUp) { // 阳线:空心或实心