From: Soeren Apel Date: Wed, 20 Mar 2019 08:43:01 +0000 (+0100) Subject: Fix variable naming X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f0b992572e7e06a1f62ede8f1bf8d9b0ad8896bc;p=pulseview.git Fix variable naming --- diff --git a/pv/views/trace/analogsignal.cpp b/pv/views/trace/analogsignal.cpp index 59924641..60ba2ca9 100644 --- a/pv/views/trace/analogsignal.cpp +++ b/pv/views/trace/analogsignal.cpp @@ -319,7 +319,7 @@ void AnalogSignal::paint_fore(QPainter &p, ViewItemPaintParams &pp) 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) { @@ -364,7 +364,7 @@ void AnalogSignal::paint_grid(QPainter &p, int y, int left, int right) } } - p.setRenderHint(QPainter::Antialiasing, wasAntialiased); + p.setRenderHint(QPainter::Antialiasing, was_antialiased); } void AnalogSignal::paint_trace(QPainter &p, diff --git a/pv/views/trace/trace.cpp b/pv/views/trace/trace.cpp index 65abaf0c..76adf1d1 100644 --- a/pv/views/trace/trace.cpp +++ b/pv/views/trace/trace.cpp @@ -292,13 +292,13 @@ void Trace::paint_back(QPainter &p, ViewItemPaintParams &pp) 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) @@ -329,11 +329,11 @@ void Trace::paint_hover_marker(QPainter &p) const pair 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() diff --git a/pv/views/trace/viewport.cpp b/pv/views/trace/viewport.cpp index 44c912a1..2ca43a0b 100644 --- a/pv/views/trace/viewport.cpp +++ b/pv/views/trace/viewport.cpp @@ -175,9 +175,10 @@ void Viewport::paintEvent(QPaintEvent*) 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++) {