mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 06:46:09 +00:00
fix(zoom): hold connected zoom before handoff
This commit is contained in:
@@ -400,7 +400,7 @@ describe("findDominantRegion", () => {
|
||||
const result = findDominantRegion(regions, 3100, { connectZooms: true });
|
||||
expect(result.transition).toBeNull();
|
||||
expect(result.region?.id).toBe("a");
|
||||
expect(result.strength).toBeGreaterThan(0);
|
||||
expect(result.strength).toBe(1);
|
||||
});
|
||||
|
||||
it("keeps the incoming region at full strength after a connected handoff", () => {
|
||||
|
||||
@@ -124,8 +124,18 @@ function getActiveRegion(
|
||||
const activeRegions = regions
|
||||
.map((region) => {
|
||||
const outgoingPair = connectedPairs.find((pair) => pair.currentRegion.id === region.id);
|
||||
if (outgoingPair && timeMs >= outgoingPair.transitionStart) {
|
||||
return { region, strength: 0 };
|
||||
if (outgoingPair) {
|
||||
if (timeMs >= outgoingPair.transitionStart) {
|
||||
return { region, strength: 0 };
|
||||
}
|
||||
|
||||
const zoomOutStart =
|
||||
outgoingPair.currentRegion.endMs -
|
||||
ZOOM_OUT_EARLY_START_MS +
|
||||
ZOOM_ANIMATION_LEAD_MS;
|
||||
if (timeMs >= zoomOutStart) {
|
||||
return { region, strength: 1 };
|
||||
}
|
||||
}
|
||||
|
||||
const incomingPair = connectedPairs.find((pair) => pair.nextRegion.id === region.id);
|
||||
|
||||
Reference in New Issue
Block a user