* Returns the maximum size in pixels of given canvas element. * @param {HTMLCanvasElement} element * @param {number} [width] - content width of parent element * @param {number} [height] - content height of parent element * @param {number} [aspectRatio] - aspect ratio to maintain
(element, width, height, aspectRatio)
| 57 | * @param {number} [aspectRatio] - aspect ratio to maintain |
| 58 | */ |
| 59 | getMaximumSize(element, width, height, aspectRatio) { |
| 60 | width = Math.max(0, width || element.width); |
| 61 | height = height || element.height; |
| 62 | return { |
| 63 | width, |
| 64 | height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height) |
| 65 | }; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * @param {HTMLCanvasElement} canvas |
nothing calls this directly
no outgoing calls
no test coverage detected