Finding size of rotated image to match top-line based on angle
问题 (illustration for reference: https://i.stack.imgur.com/Wsge0.png) Code example https://jsfiddle.net/waaentz/htrqdwjp/9/ const width = 1000; const height = 100; const canvas = document.createElement("canvas"); const stage = new createjs.Stage(canvas); const img = new Image(); const bitmap = new createjs.Bitmap(img); const baseGrid = new createjs.Shape(); const angle = 45; // Is dynamic const magicScaleFormular = 1.39 // Find scale based on height and angle img.src = getBase64(); img