| 313 | } |
| 314 | |
| 315 | Range<double> PlotWidgetBase::getVisualizationRangeX() const { |
| 316 | double left = std::numeric_limits<double>::max(); |
| 317 | double right = std::numeric_limits<double>::lowest(); |
| 318 | |
| 319 | for (const auto& info : curveList()) { |
| 320 | if (info.curve == nullptr || !info.curve->isVisible() || info.curve->data() == nullptr) { |
| 321 | continue; |
| 322 | } |
| 323 | const QRectF rect = info.curve->data()->boundingRect(); |
| 324 | if (!isUsableRect(rect)) { |
| 325 | continue; |
| 326 | } |
| 327 | left = std::min(left, rect.left()); |
| 328 | right = std::max(right, rect.right()); |
| 329 | } |
| 330 | |
| 331 | if (left > right) { |
| 332 | left = 0.0; |
| 333 | right = 0.0; |
| 334 | } |
| 335 | |
| 336 | if (isXYPlot() && std::abs(right - left) > std::numeric_limits<double>::epsilon()) { |
| 337 | const double margin = (right - left) * 0.025; |
| 338 | left -= margin; |
| 339 | right += margin; |
| 340 | } |
| 341 | return Range<double>{.min = left, .max = right}; |
| 342 | } |
| 343 | |
| 344 | Range<double> PlotWidgetBase::getVisualizationRangeY(Range<double> range_x) const { |
| 345 | double bottom = std::numeric_limits<double>::max(); |
nothing calls this directly
no test coverage detected