mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
fix(modal): sheet animation works correctly if breakpoints value does not include 1 (#23927)
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
* not begin to fade in until after
|
||||
* the 0 breakpoint.
|
||||
*/
|
||||
export const getBackdropValueForSheet = (x: number, maxBreakpoint: number, backdropBreakpoint: number) => {
|
||||
export const getBackdropValueForSheet = (x: number, backdropBreakpoint: number) => {
|
||||
|
||||
/**
|
||||
* We will use these points:
|
||||
@ -15,13 +15,17 @@ export const getBackdropValueForSheet = (x: number, maxBreakpoint: number, backd
|
||||
* We know that at the beginning breakpoint,
|
||||
* the backdrop will be hidden. We also
|
||||
* know that at the maxBreakpoint, the backdrop
|
||||
* must be fully visible.
|
||||
* must be fully visible. maxBreakpoint should
|
||||
* always be 1 even if the maximum value
|
||||
* of the breakpoints array is not 1 since
|
||||
* the animation runs from a progress of 0
|
||||
* to a progress of 1.
|
||||
* m = (y2 - y1) / (x2 - x1)
|
||||
*
|
||||
* This is simplified from:
|
||||
* m = (1 - 0) / (maxBreakpoint - backdropBreakpoint)
|
||||
*/
|
||||
const slope = 1 / (maxBreakpoint - backdropBreakpoint);
|
||||
const slope = 1 / (1 - backdropBreakpoint);
|
||||
|
||||
/**
|
||||
* From here, compute b which is
|
||||
|
Reference in New Issue
Block a user