diff --git a/DSView/pv/data/decode/rowdata.cpp b/DSView/pv/data/decode/rowdata.cpp index abcd4c2f..11544624 100644 --- a/DSView/pv/data/decode/rowdata.cpp +++ b/DSView/pv/data/decode/rowdata.cpp @@ -37,7 +37,7 @@ std::mutex RowData::_global_visitor_mutex; RowData::RowData() : _max_annotation(0), - _min_annotation(UINT64_MAX) + _min_annotation(0) { _item_count = 0; } @@ -57,6 +57,7 @@ void RowData::clear() } _annotations.clear(); _item_count = 0; + _min_annotation = 0; } uint64_t RowData::get_max_sample() @@ -75,7 +76,7 @@ uint64_t RowData::get_max_annotation() uint64_t RowData::get_min_annotation() { - if (_min_annotation == UINT64_MAX) + if (_min_annotation == 0) return 10; else return _min_annotation; @@ -120,8 +121,18 @@ bool RowData::push_annotation(Annotation *a) _item_count = _annotations.size(); _max_annotation = max(_max_annotation, a->end_sample() - a->start_sample()); - if (a->end_sample() != a->start_sample()) - _min_annotation = min(_min_annotation, a->end_sample() - a->start_sample()); + if (a->end_sample() != a->start_sample()){ + if (_min_annotation == 0){ + _min_annotation = a->end_sample() - a->start_sample(); + } + else{ + if (a->end_sample() - a->start_sample() == 2){ + int bbb = 0; + bbb++; + } + _min_annotation = min(_min_annotation, a->end_sample() - a->start_sample()); + } + } return true; diff --git a/DSView/pv/view/decodetrace.cpp b/DSView/pv/view/decodetrace.cpp index 64cbf99b..448a22fc 100644 --- a/DSView/pv/view/decodetrace.cpp +++ b/DSView/pv/view/decodetrace.cpp @@ -279,8 +279,8 @@ void DecodeTrace::paint_mid(QPainter &p, int left, int right, QColor fore, QColo _decoder_stack->get_max_annotation(row); const double max_annWidth = max_annotation / samples_per_pixel; - if ((max_annWidth > 20) || - (max_annWidth > 10 && min_annWidth > 1) || + if ((max_annWidth > 100) || + (max_annWidth > 10 && (min_annWidth > 1 || samples_per_pixel < 50)) || (max_annWidth == 0 && samples_per_pixel < 10)) { std::vector annotations; _decoder_stack->get_annotation_subset(annotations, row,