@yft-design/engine 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EngineCanvas.d.ts +7 -0
- package/dist/EngineCanvas.js +4 -0
- package/dist/core/roundedRect.js +6 -5
- package/dist/core/stroke.js +3 -2
- package/dist/export/svgExport.js +32 -35
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/interact/pathSession.js +5 -5
- package/dist/interact/pointer.d.ts +6 -0
- package/dist/interact/pointer.js +43 -2
- package/dist/interact/pointerTransform.js +3 -2
- package/dist/interact/pointerTypes.d.ts +5 -0
- package/dist/interact/snapGuide.js +2 -1
- package/dist/model/alphaHit.js +2 -1
- package/dist/model/arcLayout.js +4 -3
- package/dist/model/compatObject.d.ts +1 -1
- package/dist/model/compatObject.js +7 -6
- package/dist/model/elementTypes.d.ts +99 -0
- package/dist/model/elementTypes.js +119 -0
- package/dist/model/groupResize.js +2 -1
- package/dist/model/scene.d.ts +13 -24
- package/dist/model/scene.js +52 -61
- package/dist/render/frameOverlay.d.ts +3 -0
- package/dist/render/frameOverlay.js +1 -1
- package/dist/render/framePipeline.d.ts +3 -0
- package/dist/render/framePipeline.js +1 -0
- package/dist/render/psdEffectPainter.js +2 -1
- package/dist/render/selectionOverlay.d.ts +36 -2
- package/dist/render/selectionOverlay.js +95 -8
- package/dist/render/shadowBake.js +2 -1
- package/package.json +1 -1
|
@@ -38,6 +38,37 @@ export declare const getRotateControlSprite: () => HTMLCanvasElement;
|
|
|
38
38
|
* 角度转动,但按 90° 轴位回正(|sin|>|cos| 轴位 ±90、否则 0/180),净效果
|
|
39
39
|
* 图标最多倾斜 ±45°、箭头读向稳定不倒置 */
|
|
40
40
|
export declare const rotateIconTilt: (angleDeg: number) => number;
|
|
41
|
+
/** —— 移动端移动控件(批次 354;app controls/common moveControls 的 move 控件引擎面)——
|
|
42
|
+
* fabric 语义(fabricConf hasMobile 门逐类注入 baseControls 族):仅移动端装配,
|
|
43
|
+
* 选区右中外偏 24 屏幕px 的白圆底十字箭头图标柄,actionHandler=dragHandler
|
|
44
|
+
* (拖它=拖本体同款 move 手势),cursorStyleHandler='move',图标不随对象角度
|
|
45
|
+
* 旋转(app renderMoveControl 无 ctx.rotate——与锁图标随角度旋转不同) */
|
|
46
|
+
/** 控件本地规格(app moveControls Control 原值):x=0.5/y=0(右中)+ offsetX 24 */
|
|
47
|
+
export declare const MOVE_CONTROL_OFFSET_PX = 24;
|
|
48
|
+
/** 图标 sprite 逻辑边长(px):白圆 r=8(app renderMoveControl 的
|
|
49
|
+
* radius=cornerSize=8,fabricConf ownDefaults 全局口径)+ 两侧描边余量 */
|
|
50
|
+
export declare const MOVE_CONTROL_PX = 20;
|
|
51
|
+
/** 命中半径(px):finger 友好目标(app Control sizeX/sizeY=20 方形 + fabric 触摸
|
|
52
|
+
* padding 的口径),大于视觉半径 9——控件中心距 mr 手柄中心恒 24px,与
|
|
53
|
+
* HANDLE_HIT_PX=12 存在 4px 重叠带(命中优先序见 pointer onPointerDown 1.01) */
|
|
54
|
+
export declare const MOVE_CONTROL_HIT_PX = 16;
|
|
55
|
+
/** 移动图标 sprite(app renderMoveControl 图标段同口径:白圆 r=8 + #2c2c2c
|
|
56
|
+
* lineWidth 2 描边 + 十字箭头 1024 viewBox 缩到 16×16 填 #2c2c2c;2× 采样抗
|
|
57
|
+
* 放大糊。jsdom 无 2D 上下文时退化为空图,单测只断言几何/贴图挂载) */
|
|
58
|
+
export declare const getMoveControlSprite: () => HTMLCanvasElement;
|
|
59
|
+
/** 控件宿主判定(渲染/命中共源):单选常规族——线族(app lineControls 的
|
|
60
|
+
* defaultControls 展开不透传 isMobile)、表格/拼图(tableControls/
|
|
61
|
+
* puzzleControls=baseControls(true,false) 自制集无 move)、蒙版(maskControls)
|
|
62
|
+
* 与用户锁单选不进;多选不进(fabric ActiveSelection 走原生控件集)。
|
|
63
|
+
* 组顶(groupControls 含 moveControls)正常进——组内激活会话只有顶组面,
|
|
64
|
+
* 子手柄集不加(引擎侧边界,app fabric 交互态另有子控件面不承接) */
|
|
65
|
+
export declare const moveControlTarget: (doc: EngineDocument) => SceneNode | null;
|
|
66
|
+
/** 控件位置:fabric 规格经当前姿态变换(app positionHandler 同构——offset 恒定
|
|
67
|
+
* 屏幕像素、随对象角度绕框心旋转;mtr 手势期换边但 move 恒在本地右缘) */
|
|
68
|
+
export declare const moveControlPosition: (quad: CornerPoints, angleDeg: number, zoom: number) => {
|
|
69
|
+
x: number;
|
|
70
|
+
y: number;
|
|
71
|
+
};
|
|
41
72
|
export declare const angleBadgeCanvas: (text: string) => HTMLCanvasElement;
|
|
42
73
|
/** 旋转手势覆盖态(fabric 语义两件):手柄锚定规格快照——app 手势起始把控件
|
|
43
74
|
* 本地规格(x/y/offset,__rotateControlPosition)快照进 _currentTransform,
|
|
@@ -241,8 +272,11 @@ export declare const buildDashedBorderOverlay: (quad: CornerPoints, zoom: number
|
|
|
241
272
|
* 组内子不进)
|
|
242
273
|
* rotate 非空(旋转手势期,宿主 rotateDrag 转发):mtr 按手势起始规格贴框
|
|
243
274
|
* 随姿态转(不换边)、框中心/对象中心出角度气泡(app renderRotateControl
|
|
244
|
-
* isRotating
|
|
245
|
-
|
|
275
|
+
* isRotating 同构)。
|
|
276
|
+
* mobile(批次 354):宿主 EngineCanvasOptions.mobileControls——true 时单选
|
|
277
|
+
* 常规族在选区右中(topQuad 口径,随框转)+24 屏幕px 出移动图标柄(fabric
|
|
278
|
+
* moveControls 的 move 控件;app fabricConf hasMobile 门逐类注入的引擎面) */
|
|
279
|
+
export declare const buildSelectionOverlay: (doc: EngineDocument, zoom: number, rotate?: RotateGestureOverlay | null, mobile?: boolean) => OverlayQuad[];
|
|
246
280
|
/** 圆角手柄宿主解析(渲染/命中共用):单选矩形族或图片族(批次 101 扩档)——
|
|
247
281
|
* 组内激活态 selection[0] 是顶组(非族)自然为 null、多选不进、锁定单选在
|
|
248
282
|
* 调用方提前短路(全套手柄不出);动画/码图族在 isImageRadiusHandleNode 排除 */
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { parseColor } from '../core/color';
|
|
11
11
|
import { isReferenceLineNode, LINE_TYPES, MASK_TYPES, PuzzleNode, TableNode, GroupNode } from '../model/scene';
|
|
12
|
+
import { ElementTypes, typeKeyOf } from '../model/elementTypes';
|
|
12
13
|
import { groupContentQuad } from '../model/groupChildMove';
|
|
13
14
|
import { EDGE_HANDLE_SIDE, isEdgeHandle, isRadiusHandle, RADIUS_HANDLE_CORNER, RADIUS_HANDLE_LIST } from '../model/handles';
|
|
14
15
|
/** 屏幕空间常量(px):手柄边长、命中半径、边框线宽、旋转柄偏移 */
|
|
@@ -118,6 +119,76 @@ export const rotateIconTilt = (angleDeg) => {
|
|
|
118
119
|
const axis = Math.abs(x) > Math.abs(y) ? Math.sign(x) * 90 : Math.sign(y) * 90 - 90;
|
|
119
120
|
return angleDeg - axis;
|
|
120
121
|
};
|
|
122
|
+
/** —— 移动端移动控件(批次 354;app controls/common moveControls 的 move 控件引擎面)——
|
|
123
|
+
* fabric 语义(fabricConf hasMobile 门逐类注入 baseControls 族):仅移动端装配,
|
|
124
|
+
* 选区右中外偏 24 屏幕px 的白圆底十字箭头图标柄,actionHandler=dragHandler
|
|
125
|
+
* (拖它=拖本体同款 move 手势),cursorStyleHandler='move',图标不随对象角度
|
|
126
|
+
* 旋转(app renderMoveControl 无 ctx.rotate——与锁图标随角度旋转不同) */
|
|
127
|
+
/** 控件本地规格(app moveControls Control 原值):x=0.5/y=0(右中)+ offsetX 24 */
|
|
128
|
+
export const MOVE_CONTROL_OFFSET_PX = 24;
|
|
129
|
+
/** 图标 sprite 逻辑边长(px):白圆 r=8(app renderMoveControl 的
|
|
130
|
+
* radius=cornerSize=8,fabricConf ownDefaults 全局口径)+ 两侧描边余量 */
|
|
131
|
+
export const MOVE_CONTROL_PX = 20;
|
|
132
|
+
/** 命中半径(px):finger 友好目标(app Control sizeX/sizeY=20 方形 + fabric 触摸
|
|
133
|
+
* padding 的口径),大于视觉半径 9——控件中心距 mr 手柄中心恒 24px,与
|
|
134
|
+
* HANDLE_HIT_PX=12 存在 4px 重叠带(命中优先序见 pointer onPointerDown 1.01) */
|
|
135
|
+
export const MOVE_CONTROL_HIT_PX = 16;
|
|
136
|
+
/** 十字箭头 path(app renderMoveControl 原样:viewBox 1024,四向三角+中心圆点) */
|
|
137
|
+
const MOVE_ICON_PATH = 'M607.573333 295.908693h-184.32l92.16-92.16zM515.413333 813.42464l-92.16-92.16h184.32l-92.16 92.16M210.57536 508.586667l92.16-92.16v184.32l-92.16-92.16M820.251307 508.586667l-92.16 92.16v-184.32l92.16 92.16M446.88384 507.405653c0 37.195093 30.153387 67.345067 67.345067 67.345067 37.198507 0 67.351893-30.149973 67.351893-67.345067s-30.153387-67.345067-67.34848-67.345066c-37.195093 0-67.345067 30.149973-67.345067 67.345066z';
|
|
138
|
+
let moveSpriteCache = null;
|
|
139
|
+
/** 移动图标 sprite(app renderMoveControl 图标段同口径:白圆 r=8 + #2c2c2c
|
|
140
|
+
* lineWidth 2 描边 + 十字箭头 1024 viewBox 缩到 16×16 填 #2c2c2c;2× 采样抗
|
|
141
|
+
* 放大糊。jsdom 无 2D 上下文时退化为空图,单测只断言几何/贴图挂载) */
|
|
142
|
+
export const getMoveControlSprite = () => {
|
|
143
|
+
if (moveSpriteCache)
|
|
144
|
+
return moveSpriteCache;
|
|
145
|
+
const canvas = document.createElement('canvas');
|
|
146
|
+
canvas.width = MOVE_CONTROL_PX * 2;
|
|
147
|
+
canvas.height = MOVE_CONTROL_PX * 2;
|
|
148
|
+
const ctx = canvas.getContext('2d');
|
|
149
|
+
if (ctx) {
|
|
150
|
+
ctx.scale(2, 2);
|
|
151
|
+
const center = MOVE_CONTROL_PX / 2;
|
|
152
|
+
ctx.beginPath();
|
|
153
|
+
ctx.arc(center, center, 8, 0, Math.PI * 2);
|
|
154
|
+
ctx.strokeStyle = '#2c2c2c';
|
|
155
|
+
ctx.lineWidth = 2;
|
|
156
|
+
ctx.stroke();
|
|
157
|
+
ctx.fillStyle = '#ffffff';
|
|
158
|
+
ctx.fill();
|
|
159
|
+
if (typeof Path2D !== 'undefined') {
|
|
160
|
+
// app:translate(-radius,-radius) + scale(2·radius/1024)——图标盒 16×16 贴圆心
|
|
161
|
+
ctx.translate(center - 8, center - 8);
|
|
162
|
+
ctx.scale(16 / 1024, 16 / 1024);
|
|
163
|
+
ctx.fillStyle = '#2c2c2c';
|
|
164
|
+
ctx.fill(new Path2D(MOVE_ICON_PATH));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
moveSpriteCache = canvas;
|
|
168
|
+
return canvas;
|
|
169
|
+
};
|
|
170
|
+
/** 控件宿主判定(渲染/命中共源):单选常规族——线族(app lineControls 的
|
|
171
|
+
* defaultControls 展开不透传 isMobile)、表格/拼图(tableControls/
|
|
172
|
+
* puzzleControls=baseControls(true,false) 自制集无 move)、蒙版(maskControls)
|
|
173
|
+
* 与用户锁单选不进;多选不进(fabric ActiveSelection 走原生控件集)。
|
|
174
|
+
* 组顶(groupControls 含 moveControls)正常进——组内激活会话只有顶组面,
|
|
175
|
+
* 子手柄集不加(引擎侧边界,app fabric 交互态另有子控件面不承接) */
|
|
176
|
+
export const moveControlTarget = (doc) => {
|
|
177
|
+
if (doc.selection.length !== 1)
|
|
178
|
+
return null;
|
|
179
|
+
const node = doc.selection[0];
|
|
180
|
+
if (node instanceof TableNode || node instanceof PuzzleNode)
|
|
181
|
+
return null;
|
|
182
|
+
const type = node.typeKey;
|
|
183
|
+
if (LINE_TYPES.has(type) || MASK_TYPES.has(type))
|
|
184
|
+
return null;
|
|
185
|
+
if (isUserLockedNode(node))
|
|
186
|
+
return null;
|
|
187
|
+
return node;
|
|
188
|
+
};
|
|
189
|
+
/** 控件位置:fabric 规格经当前姿态变换(app positionHandler 同构——offset 恒定
|
|
190
|
+
* 屏幕像素、随对象角度绕框心旋转;mtr 手势期换边但 move 恒在本地右缘) */
|
|
191
|
+
export const moveControlPosition = (quad, angleDeg, zoom) => rotateControlScenePos(quad, angleDeg, zoom, { x: 0.5, y: 0, offsetX: MOVE_CONTROL_OFFSET_PX, offsetY: 0 });
|
|
121
192
|
/** 角度气泡超采样倍率(同标尺位图口径) */
|
|
122
193
|
const ANGLE_BADGE_SUPERSAMPLE = 3;
|
|
123
194
|
/** 角度气泡位图(app renderRotateControl isRotating 分支同构):rgba(44,44,44,0.9)
|
|
@@ -308,12 +379,18 @@ export const cornerOffsetToRadius = (offset, maxRadius) => {
|
|
|
308
379
|
};
|
|
309
380
|
/** 圆角手柄宿主判定(矩形):app rectControls 只挂 FabricRect 类(useCanvas 的
|
|
310
381
|
* ownDefaults 注入)——轻量 Rect 走 fabric 原生默认控件无圆角点,引擎同口径 */
|
|
311
|
-
export const isRadiusHandleNode = (node) => !!node &&
|
|
382
|
+
export const isRadiusHandleNode = (node) => !!node && node.typeKey === ElementTypes.FABRICRECT;
|
|
312
383
|
/** 圆角手柄宿主判定(图片族,批次 101):app imageControls 挂应用 FabricImage 类
|
|
313
384
|
* ——码图族(QRCode/BarCode/FabricEchart extends fabric 原生 Image,批次 92 口径)
|
|
314
385
|
* 与动画族(GIF/Video 直绘帧无圆角渲染,批次 98 勘注⑤)不继承,无圆角点 */
|
|
315
|
-
const IMAGE_RADIUS_EXCLUDED = new Set([
|
|
316
|
-
export const isImageRadiusHandleNode = (node) =>
|
|
386
|
+
const IMAGE_RADIUS_EXCLUDED = new Set([ElementTypes.QRCODE, ElementTypes.BARCODE, ElementTypes.ECHART, ElementTypes.FABRIC_ECHART]);
|
|
387
|
+
export const isImageRadiusHandleNode = (node) => {
|
|
388
|
+
if (!node)
|
|
389
|
+
return false;
|
|
390
|
+
// typeKeyOf(raw) 而非 node.typeKey:单测以 { raw } 鸭子桩直喂本谓词
|
|
391
|
+
const t = typeKeyOf(node.raw);
|
|
392
|
+
return !IMAGE_RADIUS_EXCLUDED.has(t) && (t === ElementTypes.IMAGE || t === ElementTypes.SVGIMAGE || t === ElementTypes.CROPIMAGE);
|
|
393
|
+
};
|
|
317
394
|
/** 视觉系圆角上限(app getRectCornerMaxRadius:min(视觉半宽, 视觉半高))。
|
|
318
395
|
* 尺寸读 node.dims(transformProps 同口径)——拖放建图等路径 raw 无
|
|
319
396
|
* width/height(图片默认取位图原宽),直读 raw 会得 0 半径上限/半宽,
|
|
@@ -488,7 +565,7 @@ export const handleAdaptiveVisible = (id, screenW, screenH) => {
|
|
|
488
565
|
/** 专属控件集豁免:app 侧拼图/蒙版/表格的 ml/mr/mt/mb 族不挂 getVisibility
|
|
489
566
|
* (fabric 模式同态常驻),引擎同豁免。线族不豁免——其 ml/mr 是 changeWidth
|
|
490
567
|
* 端点手柄无 getVisibility 走下方常驻分支,族内其余键仍按 adaptive 裁剪 */
|
|
491
|
-
const isAdaptiveExemptNode = (node) => node instanceof PuzzleNode || node instanceof TableNode || MASK_TYPES.has(
|
|
568
|
+
const isAdaptiveExemptNode = (node) => node instanceof PuzzleNode || node instanceof TableNode || MASK_TYPES.has(node.typeKey);
|
|
492
569
|
/** 单选手柄集 × 自适应可见性(渲染 buildSelectionOverlay 与命中 pointer.hitHandle
|
|
493
570
|
* 同源消费):多选不裁剪(fabric AS 原生控件集无 adaptive);线族 ml/mr 常驻 */
|
|
494
571
|
export const getAdaptiveSelectionHandles = (doc, quad, angleDeg, zoom, radiusNode) => {
|
|
@@ -496,7 +573,7 @@ export const getAdaptiveSelectionHandles = (doc, quad, angleDeg, zoom, radiusNod
|
|
|
496
573
|
const single = doc.selection.length === 1 ? doc.selection[0] : null;
|
|
497
574
|
if (!single || isAdaptiveExemptNode(single))
|
|
498
575
|
return handles;
|
|
499
|
-
const lineFamily = LINE_TYPES.has(
|
|
576
|
+
const lineFamily = LINE_TYPES.has(single.typeKey);
|
|
500
577
|
const size = quadScreenSize(quad, zoom);
|
|
501
578
|
return handles.filter((h) => (lineFamily && (h.id === 'ml' || h.id === 'mr')) || handleAdaptiveVisible(h.id, size.width, size.height));
|
|
502
579
|
};
|
|
@@ -510,7 +587,7 @@ export const getActiveChildHandles = (child, zoom) => {
|
|
|
510
587
|
const handles = getSelectionHandles(quad, angle, zoom);
|
|
511
588
|
if (isAdaptiveExemptNode(child))
|
|
512
589
|
return handles;
|
|
513
|
-
const lineFamily = LINE_TYPES.has(
|
|
590
|
+
const lineFamily = LINE_TYPES.has(child.typeKey);
|
|
514
591
|
const size = quadScreenSize(quad, zoom);
|
|
515
592
|
return handles.filter((h) => (lineFamily && (h.id === 'ml' || h.id === 'mr')) || handleAdaptiveVisible(h.id, size.width, size.height));
|
|
516
593
|
};
|
|
@@ -657,8 +734,11 @@ const pushHandlesWithRotate = (quads, handles, quad, angleDeg, zoom, rotate) =>
|
|
|
657
734
|
* 组内子不进)
|
|
658
735
|
* rotate 非空(旋转手势期,宿主 rotateDrag 转发):mtr 按手势起始规格贴框
|
|
659
736
|
* 随姿态转(不换边)、框中心/对象中心出角度气泡(app renderRotateControl
|
|
660
|
-
* isRotating
|
|
661
|
-
|
|
737
|
+
* isRotating 同构)。
|
|
738
|
+
* mobile(批次 354):宿主 EngineCanvasOptions.mobileControls——true 时单选
|
|
739
|
+
* 常规族在选区右中(topQuad 口径,随框转)+24 屏幕px 出移动图标柄(fabric
|
|
740
|
+
* moveControls 的 move 控件;app fabricConf hasMobile 门逐类注入的引擎面) */
|
|
741
|
+
export const buildSelectionOverlay = (doc, zoom, rotate = null, mobile = false) => {
|
|
662
742
|
// 参考线选中不画选区覆盖(批次 71):±999999 包围盒的边框/手柄全在视口外,
|
|
663
743
|
// 单键 lockMovement 是轴锁非用户锁——fabric 净视觉 = 无可见控件(锁图标落
|
|
664
744
|
// 在 2M 单位 bbox 的 br 角=屏外),引擎按同一净视觉返回空
|
|
@@ -712,6 +792,13 @@ export const buildSelectionOverlay = (doc, zoom, rotate = null) => {
|
|
|
712
792
|
if (activeChild && doc.groupEditing) {
|
|
713
793
|
pushHandlesWithRotate(quads, getActiveChildHandles(activeChild, zoom), activeChild.aCoords, activeChild.worldAngle, zoom, rotate?.onChild ? rotate : null);
|
|
714
794
|
}
|
|
795
|
+
// 移动端移动控件(批次 354):置于手柄之上(框外域与手柄无叠层,绘制序无
|
|
796
|
+
// 语义差);位置贴 topQuad 当前姿态(拖动/旋转中逐帧跟随),sprite 不随
|
|
797
|
+
// 角度旋转(app renderMoveControl 无 ctx.rotate——十字箭头恒屏幕正向)
|
|
798
|
+
if (mobile && moveControlTarget(doc)) {
|
|
799
|
+
const pos = moveControlPosition(topQuad, angle, zoom);
|
|
800
|
+
quads.push({ ...squareQuad(pos, MOVE_CONTROL_PX / zoom, [1, 1, 1, 1], 0), texture: getMoveControlSprite() });
|
|
801
|
+
}
|
|
715
802
|
return quads;
|
|
716
803
|
};
|
|
717
804
|
/** 圆角手柄宿主解析(渲染/命中共用):单选矩形族或图片族(批次 101 扩档)——
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import { effectiveShadow, shadowMargin } from '../core/shadow';
|
|
16
16
|
import { imageCornerRadius, rectCornerRadii, traceRoundedRectPath } from '../core/roundedRect';
|
|
17
17
|
import { AnimatedNode, TextNode, isTextBitmapState } from '../model/scene';
|
|
18
|
+
import { ElementTypes, typeKeyOf } from '../model/elementTypes';
|
|
18
19
|
import { charJitterY, drawParagraphPrefix, fontDeclaration } from '../model/textLayout';
|
|
19
20
|
import { drawVerticalGlyph, glyphStyleAt, verticalGlyphOps } from './verticalText';
|
|
20
21
|
/** 剪影在对象线性变换下的包围盒(旋转盒 AABB:绝对投影和,保守上界;GPU 阴影路径共用) */
|
|
@@ -84,7 +85,7 @@ export const drawSilhouette = (ctx, node, color) => {
|
|
|
84
85
|
}
|
|
85
86
|
if (node.isShapeType) {
|
|
86
87
|
const raw = node.raw;
|
|
87
|
-
if (raw
|
|
88
|
+
if (typeKeyOf(raw) === ElementTypes.ELLIPSE || typeKeyOf(raw) === ElementTypes.CIRCLE) {
|
|
88
89
|
ctx.fillStyle = color;
|
|
89
90
|
ctx.beginPath();
|
|
90
91
|
ctx.ellipse(0, 0, w / 2, h / 2, 0, 0, Math.PI * 2);
|