I would like to know how to calculate the minimum size of a display layer so that it will always cover up it's canvas regardless of it's rotation.
The image below depicts a canvas (black rectangle) with the dimensions of 1280 width x 800 height.
Center-aligned and center-registered, so that the canvas is completely covered at 0 degrees (image 1) and 90 degrees (image 2), a gradient display layer has been resized proportionately from 1280 width x 800 height (same size of the canvas) to 2048 width x 1280 height, so that the original minimum length matches the maximum length of the canvas. However, as shown in image 3, some angles will not completely cover the canvas by using this basic proportionate-resizing logic.
How can I determine the minimum size (without excess) for the gradient display layer so that when it's center-aligned and center-registered, regardless of it's angle, it will always cover the canvas?