mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 16:23:22 +00:00
FIX - preserve Home Screen drag across pages
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
springboardEdgeDirection,
|
||||
springboardPageDragCompensation,
|
||||
springboardSwipeIntent,
|
||||
springboardViewportDeltaToLocal,
|
||||
springboardViewportToLocal,
|
||||
} from '@/utils/springboardDrag'
|
||||
|
||||
describe('springboard widget drag', () => {
|
||||
@@ -57,4 +59,16 @@ describe('springboard widget drag', () => {
|
||||
expect(springboardPageDragCompensation(2, 3, 368)).toBe(368)
|
||||
expect(springboardPageDragCompensation(2, 2, 368)).toBe(0)
|
||||
})
|
||||
|
||||
it('converts viewport coordinates into local phone coordinates under zoom', () => {
|
||||
expect(
|
||||
springboardViewportToLocal(169, 238, 100, 100, 253.92, 582.36, 368, 844),
|
||||
).toEqual({ x: 100, y: 200 })
|
||||
expect(
|
||||
springboardViewportToLocal(200, 250, 100, 50, 0, 0, 368, 844),
|
||||
).toEqual({ x: 100, y: 200 })
|
||||
expect(
|
||||
springboardViewportDeltaToLocal(69, 138, 253.92, 582.36, 368, 844),
|
||||
).toEqual({ x: 100, y: 200 })
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user