From fc94c9c39c45495efc0f8fae28e32f72a56c9f90 Mon Sep 17 00:00:00 2001 From: Waozi Date: Sun, 29 Nov 2026 08:03:11 -0300 Subject: [PATCH] Measure candle marker labels within chart bounds --- AGENTS.md | 2 +- CHANGELOG.md | 5 +++++ src/candle_chart.zi | 10 +++++++++- ziran.lock | 10 +++++----- ziran.toml | 2 +- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1e3a4ee..0ac6e7c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -27,7 +27,7 @@ make dashboard-zx # ZX build of the dashboard cookbook ## Pins - Ziran toolchain: `bbaac5e493973e616e90f1f7ac84dfeb32134194` -- Kryon: `de391af5e59ed1ff45f3b3ae2bbd14352e986c54` +- Kryon: `18a629debbe88e8b114651c10a4c25bf3fb0b0f8` Public module names use `UpperCamelCase`; lowercase names are implementation modules. Commit as Waozi ; ordinary changes stay in diff --git a/CHANGELOG.md b/CHANGELOG.md index b20a1c3..5e3f22a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## [Unreleased] +- Measure candle marker buttons from their themed labels and keep them inside + the chart, so event names remain readable and their hit bounds match. +- Select the shared Kryon revision with native Go desktop processes and bounded + idle picture caches, keeping optional chart consumers on one dependency graph. + - Keep retained chart composition package-private behind the typed TSX components. Native data, calculations, hit tests and drawing hooks remain available. Add TSX components for interactive candle markers and price levels. diff --git a/src/candle_chart.zi b/src/candle_chart.zi index 51ba705..1aff0c3 100644 --- a/src/candle_chart.zi +++ b/src/candle_chart.zi @@ -542,8 +542,16 @@ CandleMarkers :: (session: Session, props: CandleChartProps, markers[index].color) marker: ButtonWidget.Props marker.key = props.key + cast(u64)1000 + cast(u64)index - marker.bounds = Rectangle.{x - 11.0, price.y + 2.0, 22.0, 20.0} marker.label = markers[index].label + marker.bounds.height = 20.0 + marker.bounds = ButtonWidget.ButtonMeasure(marker) + if marker.bounds.width > price.width { marker.bounds.width = price.width } + marker.bounds.x = x - marker.bounds.width * 0.5 + marker.bounds.y = price.y + 2.0 + if marker.bounds.x < price.x { marker.bounds.x = price.x } + if marker.bounds.x + marker.bounds.width > price.x + price.width { + marker.bounds.x = price.x + price.width - marker.bounds.width + } if ButtonView.Button(.{session = session, props = marker}) { selected = index } } index += 1 diff --git a/ziran.lock b/ziran.lock index ed44204..b505b92 100644 --- a/ziran.lock +++ b/ziran.lock @@ -65,12 +65,12 @@ "url": "https://github.com/xiph/opus.git" }, { - "commit": "de391af5e59ed1ff45f3b3ae2bbd14352e986c54", + "commit": "18a629debbe88e8b114651c10a4c25bf3fb0b0f8", "dependencies": {"audio": "waozi_xyz_ziranlang_audio_b5c6b56b7117", "avif": "waozi_xyz_ziranlang_avif_6ff696d436b6", "image_codec": "waozi_xyz_ziranlang_image_codec_3017f0d1cc56", "libaom": "src_aomedia_googlesource_com_aom_b141d9c45db2", "libavif": "src_github_com_AOMediaCodec_libavif_1aadfad932c9", "libwebp": "src_github_com_webmproject_libwebp_1844042d1ca7", "sdl3": "src_github_com_libsdl_org_SDL_829a65d769d9", "webp": "waozi_xyz_ziranlang_webp_4b9a61d32460"}, "dependency_refs": {"audio": "b5c6b56b71172c4361ae01e3afdd2118bdac0975", "avif": "6ff696d436b6b4f142eb1e3ecf210de7adfa048f", "image_codec": "3017f0d1cc56975aa29c600a1f55a62e1193cf7b", "libaom": "b141d9c45db236335351c8a4b2a14b3ade27c937", "libavif": "1aadfad932c98c069a1204261b1856f81f3bc199", "libwebp": "1844042d1ca751e62e61df7617dba19c98588339", "sdl3": "829a65d769d935c4852f8159e964312c0957260a", "webp": "4b9a61d32460d481624fe0f83996a7de50327dfe"}, - "id": "waozi_xyz_kryonlabs_kryon_de391af5e59e", + "id": "waozi_xyz_kryonlabs_kryon_18a629debbe8", "name": "kryon", - "ref": "de391af5e59ed1ff45f3b3ae2bbd14352e986c54", + "ref": "18a629debbe88e8b114651c10a4c25bf3fb0b0f8", "url": "https://git.waozi.xyz/kryonlabs/kryon.git" }, { @@ -119,8 +119,8 @@ } ], "root": { - "dependencies": {"kryon": "waozi_xyz_kryonlabs_kryon_de391af5e59e"}, - "dependency_refs": {"kryon": "de391af5e59ed1ff45f3b3ae2bbd14352e986c54"}, + "dependencies": {"kryon": "waozi_xyz_kryonlabs_kryon_18a629debbe8"}, + "dependency_refs": {"kryon": "18a629debbe88e8b114651c10a4c25bf3fb0b0f8"}, "name": "plot" }, "toolchain": { diff --git a/ziran.toml b/ziran.toml index 0943f9c..d3e6c27 100644 --- a/ziran.toml +++ b/ziran.toml @@ -10,7 +10,7 @@ ref = "bbaac5e493973e616e90f1f7ac84dfeb32134194" [dependencies.kryon] git = "https://git.waozi.xyz/kryonlabs/kryon.git" -ref = "de391af5e59ed1ff45f3b3ae2bbd14352e986c54" +ref = "18a629debbe88e8b114651c10a4c25bf3fb0b0f8" [exports] # Public module is Plot; the lowercase export is retained for older imports.