Fix scale issue with new draw lines (#3971)
This PR fixes a bug where new draw shapes (created after 500 points) would have scale 1. ### Change Type - [x] `sdk` — Changes the tldraw SDK - [x] `bugfix` — Bug fix ### Test Plan 1. Zoom in a lot 2. Draw for a long time 3. When the new draw shape happens, the new draw shape should have the correct scale
This commit is contained in:
parent
e48f4bb798
commit
b3e378a9c9
1 changed files with 3 additions and 0 deletions
|
@ -642,6 +642,8 @@ export class Drawing extends StateNode {
|
|||
|
||||
const newShapeId = createShapeId()
|
||||
|
||||
const props = this.editor.getShape<DrawableShape>(id)!.props
|
||||
|
||||
this.editor.createShapes<DrawableShape>([
|
||||
{
|
||||
id: newShapeId,
|
||||
|
@ -650,6 +652,7 @@ export class Drawing extends StateNode {
|
|||
y: toFixed(inputs.currentPagePoint.y),
|
||||
props: {
|
||||
isPen: this.isPenOrStylus,
|
||||
scale: props.scale,
|
||||
segments: [
|
||||
{
|
||||
type: 'free',
|
||||
|
|
Loading…
Reference in a new issue