Skip to content

Commit 6ee2139

Browse files
committed
fix(edgeless): polygone select zone is now takin smoothing handles and curve into account
1 parent d6e4f8f commit 6ee2139

File tree

4 files changed

+689
-7
lines changed

4 files changed

+689
-7
lines changed

packages/affine/gfx/shape/src/element-view.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,15 @@ export class ShapeElementView extends GfxElementModelView<ShapeElementModel> {
201201
// a boolean array; stash/pop must bracket the mutation symmetrically
202202
// so that elementUpdated is emitted with props['smoothFlags'] in all
203203
// cases (null → array, array → modified array).
204+
this.model.stash('xywh');
205+
this.model.stash('vertices');
204206
this.model.stash('smoothFlags');
205207
this.model.stash('controlPoints');
206208
this._vertexEditingOverlay.toggleVertexSmooth(idx);
207209
this.model.pop('controlPoints');
208210
this.model.pop('smoothFlags');
211+
this.model.pop('vertices');
212+
this.model.pop('xywh');
209213
this._surfaceComponent?.refresh();
210214
}
211215
return;
@@ -263,6 +267,7 @@ export class ShapeElementView extends GfxElementModelView<ShapeElementModel> {
263267
this._vertexEditingOverlay!.activeBezierHandleType = this._pendingBezierHandle.handleIndex;
264268

265269
this.model.stash('xywh');
270+
this.model.stash('vertices');
266271
this.model.stash('controlPoints');
267272

268273
const [startMX, startMY] = this.gfx.viewport.toModelCoord(e.x, e.y);
@@ -322,6 +327,7 @@ export class ShapeElementView extends GfxElementModelView<ShapeElementModel> {
322327
this._vertexEditingOverlay.activeBezierHandleType = -1;
323328
}
324329
this.model.pop('controlPoints');
330+
this.model.pop('vertices');
325331
this.model.pop('xywh');
326332
this._surfaceComponent?.refresh();
327333
return;

0 commit comments

Comments
 (0)