fix(render): convert Trace::width through the UI scale, and fold the controller's tolerance conversion into Style::device()
This commit is contained in:
1 parent
7500fc90d2
commit
69495a3799
7 files changed
+158
-24
No files matched your search
@@ -743,7 +743,12 @@ void Renderer::draw_traces(const Plot& plot, const PlotLayout& layout) {
|
||||
|
||||
stage_xy(gather_.data(), static_cast<u32>(gather_.size() / 2u),
|
||||
plot.x_axis(trace.axis_x).log, plot.y_axis(trace.axis_y).log);
|
||||
flush_lines(mapping(plot, trace.axis_x, trace.axis_y), trace.color, trace.width);
|
||||
// A trace's width is a logical size like every other stroke here, so it is
|
||||
// converted too: left raw, a 1.5 px trace would be drawn 1.5 device px against a
|
||||
// 3 device px axis line at scale 2 -- half the logical weight, which inverts the
|
||||
// trace/axis hierarchy on a high-DPI panel.
|
||||
flush_lines(mapping(plot, trace.axis_x, trace.axis_y), trace.color,
|
||||
style_.device(trace.width));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user