*Creates an instance of ScaleManager.
(callback = () => {})
| 13 | *Creates an instance of ScaleManager. |
| 14 | */ |
| 15 | constructor(callback = () => {}) { |
| 16 | console.warn('SpringRoll.ScaleManager has been deprecated. Use SpringRoll.SafeScaleManager instead.'); |
| 17 | |
| 18 | this.width = 1; |
| 19 | this.height = 1; |
| 20 | this.callback = callback; |
| 21 | |
| 22 | /** @private */ |
| 23 | this.resizer = new ResizeHelper(this.onResize.bind(this)); |
| 24 | |
| 25 | if (callback instanceof Function) { |
| 26 | this.enable(callback); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * onResize maps and passes the relevant data to the user provided callback function. |