( stepPair: Tuple<Step>, dimensions?: Dimensions )
| 174 | } |
| 175 | |
| 176 | export function scaleToFocus( |
| 177 | stepPair: Tuple<Step>, |
| 178 | dimensions?: Dimensions |
| 179 | ): Animation<number> { |
| 180 | if (!dimensions) { |
| 181 | return () => 1; |
| 182 | } |
| 183 | |
| 184 | const [prev, next] = stepPair.spread(); |
| 185 | |
| 186 | const prevZoom = getZoom(prev, dimensions); |
| 187 | const nextZoom = getZoom(next, dimensions); |
| 188 | |
| 189 | return t => |
| 190 | tween( |
| 191 | prevZoom || nextZoom!, |
| 192 | nextZoom || prevZoom!, |
| 193 | t, |
| 194 | easing.easeInOutQuad |
| 195 | ); |
| 196 | } |
| 197 | |
| 198 | // |
| 199 |
no test coverage detected