Update DrawSession.ts (#272)
This commit is contained in:
parent
59d085b5ac
commit
ec9a40b800
1 changed files with 2 additions and 4 deletions
|
@ -28,6 +28,7 @@ export class DrawSession extends Session {
|
||||||
// when the draw session ends; if the user hasn't added additional
|
// when the draw session ends; if the user hasn't added additional
|
||||||
// points, this single point will be interpreted as a "dot" shape.
|
// points, this single point will be interpreted as a "dot" shape.
|
||||||
this.points = [[0, 0, point[2] || 0.5]]
|
this.points = [[0, 0, point[2] || 0.5]]
|
||||||
|
this.shiftedPoints = [...this.points]
|
||||||
}
|
}
|
||||||
|
|
||||||
start = () => void null
|
start = () => void null
|
||||||
|
@ -122,10 +123,7 @@ export class DrawSession extends Session {
|
||||||
// If the new top left is the same as the previous top left,
|
// If the new top left is the same as the previous top left,
|
||||||
// we don't need to shift anything: we just shift the new point
|
// we don't need to shift anything: we just shift the new point
|
||||||
// and add it to the shifted points array.
|
// and add it to the shifted points array.
|
||||||
points = [
|
points = [...this.shiftedPoints, Vec.sub(newPoint, delta).concat(newPoint[2])]
|
||||||
...this.shiftedPoints,
|
|
||||||
Vec.sub(newPoint, Vec.sub(topLeft, this.origin)).concat(newPoint[2]),
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.shiftedPoints = points
|
this.shiftedPoints = points
|
||||||
|
|
Loading…
Reference in a new issue