Improved limits of zoomed in slider in footer for stack linear chart.

This commit is contained in:
23rd
2023-10-02 16:09:22 +03:00
committed by John Preston
parent cb4c629178
commit f8e80bc266
2 changed files with 28 additions and 13 deletions
@@ -938,7 +938,7 @@ auto StackLinearChartView::maybeLocalZoom(
// 1 day in middle of limits.
constexpr auto kRangeLength = int(0);
constexpr auto kLeftSide = int(kLimitLength / 2 + kRangeLength);
constexpr auto kRightSide = int(kLimitLength / 2);
constexpr auto kRightSide = int(kLimitLength / 2) + int(1);
_transition.progress = args.progress;
if (args.type == LocalZoomArgs::Type::SkipCalculation) {
@@ -963,7 +963,7 @@ auto StackLinearChartView::maybeLocalZoom(
float64(localRangeIndex + kRangeLength),
};
_transition.zoomedInLimitXIndices = (xIndex < kLeftSide)
? Limits{ 0, kLimitLength + kRangeLength }
? Limits{ 0, kLeftSide + kRightSide }
: (xIndex > (backIndex - kRightSide - kRangeLength))
? Limits{ float64(backIndex - kLimitLength), float64(backIndex) }
: Limits{ float64(xIndex - kLeftSide), float64(xIndex + kRightSide) };