]> sigrok.org Git - pulseview.git/blobdiff - pv/views/decoder_output/QHexView.cpp
QHexView: Fix cursor max pos
[pulseview.git] / pv / views / decoder_output / QHexView.cpp
index 53120ce07b75a6cdc296cd6a88e9e87510bdd8fd..a4e71f5c458c8bdab060d0e37fc79982977e07b6 100644 (file)
@@ -69,6 +69,8 @@ void QHexView::setData(QByteArray *data)
        data_ = data;
        cursorPos_ = 0;
        resetSelection(0);
+
+       viewport()->update();
 }
 
 void QHexView::showFromOffset(size_t offset)
@@ -491,11 +493,8 @@ void QHexView::setCursorPos(int position)
                position = 0;
 
        int maxPos = 0;
-       if (data_) {
+       if (data_)
                maxPos = data_->count() * 2;
-               if (data_->count() % BYTES_PER_LINE)
-                       maxPos++;
-       }
 
        if (position > maxPos)
                position = maxPos;