@ignore
(corners: any)
| 324 | |
| 325 | /** @ignore */ |
| 326 | function fixOverlappingCorners(corners: any) { |
| 327 | const [upperLeft, upperRight, lowerRight, lowerLeft] = corners; |
| 328 | const factors = [ |
| 329 | // eslint-disable-next-line @typescript-eslint/restrict-plus-operands |
| 330 | Math.abs(w) / (upperLeft.x + upperRight.x), |
| 331 | // eslint-disable-next-line @typescript-eslint/restrict-plus-operands |
| 332 | Math.abs(h) / (upperRight.y + lowerRight.y), |
| 333 | // eslint-disable-next-line @typescript-eslint/restrict-plus-operands |
| 334 | Math.abs(w) / (lowerRight.x + lowerLeft.x), |
| 335 | // eslint-disable-next-line @typescript-eslint/restrict-plus-operands |
| 336 | Math.abs(h) / (upperLeft.y + lowerLeft.y), |
| 337 | ]; |
| 338 | const minFactor = Math.min(...factors); |
| 339 | if (minFactor <= 1) { |
| 340 | corners.forEach((radii: any) => { |
| 341 | radii.x *= minFactor; |
| 342 | radii.y *= minFactor; |
| 343 | }); |
| 344 | } |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | if (globalThis.CanvasRenderingContext2D) { |