]> sigrok.org Git - pulseview.git/commitdiff
Pixel aligned signal labels
authorJoel Holdsworth <redacted>
Thu, 1 Nov 2012 23:17:02 +0000 (23:17 +0000)
committerJoel Holdsworth <redacted>
Thu, 1 Nov 2012 23:19:58 +0000 (23:19 +0000)
pv/signal.cpp

index bcb328136826d42a1451e149af6a1cbe32054923..9bc44d9d161d2fbe6316d6b291ba1bb0f3530158 100644 (file)
@@ -106,13 +106,14 @@ QRectF Signal::get_label_rect(const QRect &rect)
 {
        using pv::view::View;
 
 {
        using pv::view::View;
 
-       const float nominal_offset = get_nominal_offset(rect);
+       const float nominal_offset = get_nominal_offset(rect) + 0.5;
        const QSizeF label_size(
                _text_size.width() + View::LabelPadding.width() * 2,
                _text_size.height() + View::LabelPadding.height() * 2);
        const float label_arrow_length = label_size.height() / 2;
        return QRectF(
        const QSizeF label_size(
                _text_size.width() + View::LabelPadding.width() * 2,
                _text_size.height() + View::LabelPadding.height() * 2);
        const float label_arrow_length = label_size.height() / 2;
        return QRectF(
-               rect.right() - label_arrow_length - label_size.width(),
+               rect.right() - label_arrow_length -
+                       label_size.width() - 0.5,
                nominal_offset - label_size.height() / 2,
                label_size.width(), label_size.height());
 }
                nominal_offset - label_size.height() / 2,
                label_size.width(), label_size.height());
 }