Skip to content

Commit 19d0050

Browse files
committed
refactor: review fixes
1 parent c09417b commit 19d0050

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/helpers/helpers.canvas.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import type {
1010
import type {
1111
TRBL,
1212
SplinePoint,
13-
RoundedRect
13+
RoundedRect,
14+
TRBLCorners
1415
} from '../types/geometric.js';
1516
import {isArray, isNullOrUndef} from './helpers.core.js';
1617
import {PI, TAU, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, RAD_PER_DEG} from './helpers.math.js';
@@ -490,13 +491,12 @@ export function renderText(
490491
* @param ctx - Context
491492
* @param rect - Bounding rect
492493
*/
493-
export function addRoundedRectPath(ctx: CanvasRenderingContext2D, rect: RoundedRect) {
494+
export function addRoundedRectPath(
495+
ctx: CanvasRenderingContext2D,
496+
rect: RoundedRect & { radius: TRBLCorners }
497+
) {
494498
const {x, y, w, h, radius} = rect;
495499

496-
if (!radius || typeof radius === 'number') {
497-
return;
498-
}
499-
500500
// top left arc
501501
ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, -HALF_PI, PI, true);
502502

0 commit comments

Comments
 (0)