Round points when a draw shape is completed
This commit is contained in:
parent
6d3251f195
commit
b1002b70e9
1 changed files with 5 additions and 1 deletions
|
@ -170,6 +170,8 @@ export class DrawSession extends BaseSession {
|
|||
const { shapeId } = this
|
||||
const pageId = this.app.currentPageId
|
||||
|
||||
const shape = this.app.getShape<DrawShape>(shapeId)
|
||||
|
||||
return {
|
||||
id: 'create_draw',
|
||||
before: {
|
||||
|
@ -194,7 +196,9 @@ export class DrawSession extends BaseSession {
|
|||
[pageId]: {
|
||||
shapes: {
|
||||
[shapeId]: {
|
||||
...this.app.getShape<DrawShape>(shapeId),
|
||||
...shape,
|
||||
point: Vec.round(shape.point),
|
||||
points: shape.points.map((pt) => Vec.round(pt)),
|
||||
isComplete: true,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue