Skip to content

Commit 8dd26be

Browse files
committed
Add isCCW param for addCircle
1 parent 8f016e9 commit 8dd26be

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

packages/skia/cpp/api/JsiSkPath.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,11 @@ class JsiSkPath : public JsiSkWrappingSharedPtrHostObject<SkPath> {
436436
auto x = arguments[0].asNumber();
437437
auto y = arguments[1].asNumber();
438438
auto r = arguments[2].asNumber();
439-
getObject()->addCircle(x, y, r);
439+
auto direction = SkPathDirection::kCW;
440+
if (count >= 4 && arguments[3].getBool()) {
441+
direction = SkPathDirection::kCCW;
442+
}
443+
getObject()->addCircle(x, y, r, direction);
440444
return thisValue.getObject(runtime);
441445
}
442446

packages/skia/src/skia/types/Path/Path.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ export interface SkPath extends SkJSIInstance<"Path"> {
486486
@param radius distance from center to edge
487487
@return reference to SkPath
488488
*/
489-
addCircle(x: number, y: number, r: number): SkPath;
489+
addCircle(x: number, y: number, r: number, isCCW?: boolean): SkPath;
490490

491491
getLastPt(): { x: number; y: number };
492492

packages/skia/src/skia/web/JsiSkPath.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
303303
return this.ref.isVolatile();
304304
}
305305

306-
addCircle(x: number, y: number, r: number) {
307-
this.ref.addCircle(x, y, r);
306+
addCircle(x: number, y: number, r: number, isCCW?: boolean) {
307+
this.ref.addCircle(x, y, r, isCCW);
308308
return this;
309309
}
310310

0 commit comments

Comments
 (0)