X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fruler.cpp;h=ab08a32011cdef2aad64f62cb8e2d4aaa8fdb14b;hb=2d14193769fead2c7882c63246b12b0f80df23d5;hp=6313ee5df288abfc794fdedf5f0462cf9d3715c5;hpb=3ccf0f7f5b1b31ac628a983a2becee6f4c4c1507;p=pulseview.git diff --git a/pv/view/ruler.cpp b/pv/view/ruler.cpp index 6313ee5..ab08a32 100644 --- a/pv/view/ruler.cpp +++ b/pv/view/ruler.cpp @@ -154,7 +154,6 @@ void Ruler::paintEvent(QPaintEvent*) const int minor_tick_y1 = (major_tick_y1 + ruler_height) / 2; QPainter p(this); - p.setRenderHint(QPainter::Antialiasing); // Draw the tick marks p.setPen(palette().color(foregroundRole())); @@ -174,6 +173,8 @@ void Ruler::paintEvent(QPaintEvent*) // Draw the hover mark draw_hover_mark(p, text_height); + p.setRenderHint(QPainter::Antialiasing); + // The cursor labels are not drawn with the arrows exactly on the // bottom line of the widget, because then the selection shadow // would be clipped away. @@ -197,8 +198,7 @@ Ruler::TickPositions Ruler::calculate_tick_positions( { TickPositions tp; - const double minor_period = - (major_period / MinorTickSubdivision).convert_to(); + const pv::util::Timestamp minor_period = major_period / MinorTickSubdivision; const pv::util::Timestamp first_major_division = floor(offset / major_period); const pv::util::Timestamp first_minor_division = ceil(offset / minor_period); const pv::util::Timestamp t0 = first_major_division * major_period; @@ -213,7 +213,7 @@ Ruler::TickPositions Ruler::calculate_tick_positions( x = ((t - offset) / scale).convert_to(); if (division % MinorTickSubdivision == 0) { - // Recalculate 't' without using 'minor_period' which is of type double. + // Recalculate 't' without using 'minor_period' which is a fraction t = t0 + division / MinorTickSubdivision * major_period; tp.major.emplace_back(x, format_function(t)); } else {