Skip to content

Commit

Permalink
Scale Factor change (#12876)
Browse files Browse the repository at this point in the history
  • Loading branch information
QilongTang authored May 12, 2022
1 parent bef483c commit fae601a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/DynamoCore/Graph/Workspaces/WorkspaceModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,6 @@ public virtual void Clear()
X = 0.0;
Y = 0.0;
Zoom = 1.0;
ScaleFactor = 1.0;
// Reset the workspace offset
OnCurrentOffsetChanged(this, new PointEventArgs(new Point2D(X, Y)));
workspaceLoaded = true;
Expand Down
11 changes: 11 additions & 0 deletions test/DynamoCoreTests/Graph/Workspaces/WorkspaceModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,16 @@ public void WillNotStoreInvalidBase64StringInThumbnailProperty()
// Assert
Assert.IsNull(hws.Thumbnail);
}

[Test]
public void ScaleFactorTest()
{
// Set scale factor to extra large
this.CurrentDynamoModel.CurrentWorkspace.ScaleFactor = 10000;
this.CurrentDynamoModel.ClearCurrentWorkspace();

// Assert scale factor did not got reset after workspace clear
Assert.AreEqual(this.CurrentDynamoModel.CurrentWorkspace.ScaleFactor, 10000);
}
}
}

0 comments on commit fae601a

Please sign in to comment.