projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement MainWindow::add_view()
[pulseview.git]
/
pv
/
view
/
decodetrace.cpp
diff --git
a/pv/view/decodetrace.cpp
b/pv/view/decodetrace.cpp
index ab9514cd4e4da34e706c522ecb4244a123a38ad9..c2369e866fbe3b7286c602adc41735ed1c6a579b 100644
(file)
--- a/
pv/view/decodetrace.cpp
+++ b/
pv/view/decodetrace.cpp
@@
-169,7
+169,10
@@
pair<int, int> DecodeTrace::v_extents() const
{
const int row_height = (ViewItemPaintParams::text_height() * 6) / 4;
{
const int row_height = (ViewItemPaintParams::text_height() * 6) / 4;
- return make_pair(-row_height, row_height * max_visible_rows_);
+ // Make an empty decode trace appear symmetrical
+ const int row_count = max(1, max_visible_rows_);
+
+ return make_pair(-row_height, row_height * row_count);
}
void DecodeTrace::paint_back(QPainter &p, const ViewItemPaintParams &pp)
}
void DecodeTrace::paint_back(QPainter &p, const ViewItemPaintParams &pp)
@@
-195,6
+198,9
@@
void DecodeTrace::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
return;
}
return;
}
+ // Set default pen to allow for text width calculation
+ p.setPen(Qt::black);
+
// Iterate through the rows
int y = get_visual_y();
pair<uint64_t, uint64_t> sample_range = get_sample_range(
// Iterate through the rows
int y = get_visual_y();
pair<uint64_t, uint64_t> sample_range = get_sample_range(
@@
-239,6
+245,9
@@
void DecodeTrace::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
// Draw the hatching
draw_unresolved_period(p, annotation_height, pp.left(), pp.right());
// Draw the hatching
draw_unresolved_period(p, annotation_height, pp.left(), pp.right());
+ if ((int)visible_rows_.size() > max_visible_rows_)
+ owner_->extents_changed(false, true);
+
// Update the maximum row count if needed
max_visible_rows_ = std::max(max_visible_rows_, (int)visible_rows_.size());
}
// Update the maximum row count if needed
max_visible_rows_ = std::max(max_visible_rows_, (int)visible_rows_.size());
}