diff --git a/examples/glfw_demo.cpp b/examples/glfw_demo.cpp index 1a2879d..7dac57b 100644 --- a/examples/glfw_demo.cpp +++ b/examples/glfw_demo.cpp @@ -580,7 +580,12 @@ int main() { } else { graph.set_cursor_x(cursor_a, xr.min + 0.35 * xr.span()); graph.set_cursor_x(cursor_b, xr.min + 0.65 * xr.span()); - graph.set_region(region, xr.min + 0.40 * xr.span(), xr.min + 0.60 * xr.span()); + // The region sits on the left sixth of the window, not across its middle: it is a + // grabbable handle, so a region over the centre would turn the pan gesture the + // `PLOT_DEMO_FOLLOW` script makes (and the pan a user makes) into a region drag. + // The two cursors stay where they are -- neither is within a grab radius of the + // centre either, which is why the script's pan has always been a pan. + graph.set_region(region, xr.min + 0.06 * xr.span(), xr.min + 0.18 * xr.span()); } } diff --git a/examples/multiplot_demo.cpp b/examples/multiplot_demo.cpp index d71ec3b..e9551a3 100644 --- a/examples/multiplot_demo.cpp +++ b/examples/multiplot_demo.cpp @@ -655,6 +655,17 @@ int main() { " %.4f, max %.4f, integral %.4f\n", region, rs.x0, rs.x1, static_cast(rs.count), rs.mean, rs.rms, rs.min, rs.max, rs.integral); + // The region's last-frame geometry on row 0, as the layout measured it: the rect the + // fill and the bound strokes are drawn in, which is also what the screenshot's region + // pixels are read against. + for (const plot::RegionLayout& rl : std::as_const(figure.plot(0)).layout().regions) { + if (rl.region != region) continue; + std::printf("[multiplot] region %u: fill x %.1f y %.1f w %.1f h %.1f, bounds at %.1f and" + " %.1f\n", + region, rl.fill.x, rl.fill.y, rl.fill.w, rl.fill.h, + static_cast(plot::handle_column(rl.left_handle)), + static_cast(plot::handle_column(rl.right_handle))); + } std::printf("[multiplot] cursors a %.6f s, b %.6f s, dx %g s dy %g\n", figure.plot(0).cursor(cursor_a).x, figure.plot(0).cursor(cursor_b).x, figure.plot(0).measurement(measure).dx, figure.plot(0).measurement(measure).dy);