void AnalogSignal::paint_grid(QPainter &p, int y, int left, int right)
{
- bool wasAntialiased = p.testRenderHint(QPainter::Antialiasing);
+ bool was_antialiased = p.testRenderHint(QPainter::Antialiasing);
p.setRenderHint(QPainter::Antialiasing, false);
if (pos_vdivs_ > 0) {
}
}
- p.setRenderHint(QPainter::Antialiasing, wasAntialiased);
+ p.setRenderHint(QPainter::Antialiasing, was_antialiased);
}
void AnalogSignal::paint_trace(QPainter &p,
void Trace::paint_axis(QPainter &p, ViewItemPaintParams &pp, int y)
{
- bool wasAntialiased = p.testRenderHint(QPainter::Antialiasing);
+ bool was_antialiased = p.testRenderHint(QPainter::Antialiasing);
p.setRenderHint(QPainter::Antialiasing, false);
p.setPen(axis_pen_);
p.drawLine(QPointF(pp.left(), y), QPointF(pp.right(), y));
- p.setRenderHint(QPainter::Antialiasing, wasAntialiased);
+ p.setRenderHint(QPainter::Antialiasing, was_antialiased);
}
void Trace::add_color_option(QWidget *parent, QFormLayout *form)
const pair<int, int> extents = v_extents();
- bool wasAntialiased = p.testRenderHint(QPainter::Antialiasing);
+ bool was_antialiased = p.testRenderHint(QPainter::Antialiasing);
p.setRenderHint(QPainter::Antialiasing, false);
p.drawLine(x, get_visual_y() + extents.first,
x, get_visual_y() + extents.second);
- p.setRenderHint(QPainter::Antialiasing, wasAntialiased);
+ p.setRenderHint(QPainter::Antialiasing, was_antialiased);
}
void Trace::create_popup_form()
QPainter p(this);
- bool useAntialiasing =
+ // Disable antialiasing for high-DPI displays
+ bool use_antialiasing =
window()->windowHandle()->screen()->devicePixelRatio() < 2.0;
- p.setRenderHint(QPainter::Antialiasing, useAntialiasing);
+ p.setRenderHint(QPainter::Antialiasing, use_antialiasing);
for (LayerPaintFunc *paint_func = layer_paint_funcs;
*paint_func; paint_func++) {