修复时间轴前进、后退范围bug
This commit is contained in:
@@ -314,7 +314,7 @@ const Timeline: React.FC<TimelineProps> = ({
|
||||
if (timeRange) {
|
||||
if (next < minTime) next = maxTime;
|
||||
} else {
|
||||
if (next <= 0) next = 1440;
|
||||
if (next < 0) next += 1440;
|
||||
}
|
||||
return next;
|
||||
});
|
||||
|
||||
@@ -177,7 +177,7 @@ const Timeline: React.FC<TimelineProps> = ({
|
||||
const handleStepBackward = useCallback(() => {
|
||||
setCurrentYear((prev: number) => {
|
||||
let next = prev - 1;
|
||||
if (next < minTime) next = maxTime;
|
||||
if (next < minTime) next += maxTime - minTime + 1;
|
||||
return next;
|
||||
});
|
||||
}, [minTime, maxTime]);
|
||||
|
||||
Reference in New Issue
Block a user