pos_vdivs_(1),
neg_vdivs_(1),
resolution_(0),
- autoranging_(1)
+ autoranging_(true)
{
pv::data::Analog* analog_data =
dynamic_cast<pv::data::Analog*>(data().get());
{
p.setPen(base_->colour());
- QPointF *points = new QPointF[end - start];
+ const int64_t points_count = end - start;
+
+ QPointF *points = new QPointF[points_count];
QPointF *point = points;
pv::data::SegmentAnalogDataIterator* it =
}
segment->end_sample_iteration(it);
- p.drawPolyline(points, point - points);
+ p.drawPolyline(points, points_count);
delete[] points;
}
neg_vdivs_ = 0;
}
+ // Split up the divs if there are negative values but no negative divs
+ if ((min < 0) && (neg_vdivs_ == 0)) {
+ neg_vdivs_ = pos_vdivs_ / 2;
+ pos_vdivs_ -= neg_vdivs_;
+ }
+
double min_value_per_div;
if ((pos_vdivs_ > 0) && (neg_vdivs_ > 0))
min_value_per_div = std::max(max / pos_vdivs_, -min / neg_vdivs_);