]> sigrok.org Git - pulseview.git/commitdiff
Refactored Trace::get_label_rect to use get_y
authorJoel Holdsworth <redacted>
Wed, 25 Sep 2013 07:17:49 +0000 (16:17 +0900)
committerJoel Holdsworth <redacted>
Wed, 9 Oct 2013 21:18:26 +0000 (22:18 +0100)
pv/view/trace.cpp

index 67ea3a02788416c670a6c1d3f12d591d402df84d..e9424750c997237ff1f5623387d286f6145f97dd 100644 (file)
@@ -211,7 +211,6 @@ QRectF Trace::get_label_rect(int right)
        using pv::view::View;
 
        assert(_view);
-       const int y = _v_offset - _view->v_offset();
 
        const QSizeF label_size(
                _text_size.width() + View::LabelPadding.width() * 2,
@@ -219,7 +218,7 @@ QRectF Trace::get_label_rect(int right)
        const float label_arrow_length = label_size.height() / 2;
        return QRectF(
                right - label_arrow_length - label_size.width() - 0.5,
-               y + 0.5f - label_size.height() / 2,
+               get_y() + 0.5f - label_size.height() / 2,
                label_size.width(), label_size.height());
 }