fix(render): convert Trace::width through the UI scale, and fold the controller's tolerance conversion into Style::device()

This commit is contained in:
Martino Ferrari committed 2026-09-28 12:26:06 +02:00
1 parent 7500fc90d2
commit 69495a3799
7 files changed
+158 -24

No files matched your search

+5 -3
View File
@@ -59,9 +59,11 @@ enum class DragMode {
/// therefore change its *physical* size with the display: a 5 px grab radius is
/// half the hand movement on a 2x panel, so the same cursor becomes harder to
/// catch there. Both tolerances -- the cursor grab radius and the box-zoom click
/// threshold -- are therefore logical constants multiplied by `Plot::ui_scale()`,
/// which is also why the controller reads the scale off the plot it already holds
/// instead of keeping a copy a host would have to keep in step.
/// threshold -- are therefore logical constants, converted through
/// `Style::device()` at the scale of the plot the controller already holds: that is
/// the single place the logical -> device rule lives, and the plot is the one that
/// knows what its device pixel is worth, so the controller keeps no copy of the scale
/// for a host to keep in step.
///
/// The middle-drag axis zoom's per-pixel gain is deliberately *not* in that group:
/// it is a data-navigation sensitivity rather than a size (the wheel and `+`/`-`