Improved casting of limits for std::distance in stack linear chart view.

This commit is contained in:
23rd
2023-09-29 15:46:10 +03:00
committed by John Preston
parent be82df72e6
commit ded3f135bb
2 changed files with 5 additions and 3 deletions
@@ -905,8 +905,8 @@ int StackLinearChartView::findXIndexByPosition(
const auto nearestXPercentageIt = ((right) > (left)) ? (it - 1) : it;
return std::clamp(
std::distance(begin(chartData.xPercentage), nearestXPercentageIt),
long(localStart),
long(localEnd));
std::ptrdiff_t(localStart),
std::ptrdiff_t(localEnd));
}
AbstractChartView::HeightLimits StackLinearChartView::heightLimits(