Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rh): scaling incorrectly when copy pasting from one doc to another #310

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Rhino;
using Rhino.DocObjects;
using Rhino.Geometry;
using Speckle.Connectors.Common.Caching;
using Speckle.Connectors.DUI.Bindings;
using Speckle.Connectors.DUI.Bridge;
using Speckle.Connectors.DUI.Models;
Expand All @@ -18,23 +19,28 @@ public sealed class RhinoBasicConnectorBinding : IBasicConnectorBinding
public BasicConnectorBindingCommands Commands { get; }

private readonly DocumentModelStore _store;
private readonly ISendConversionCache _sendConversionCache;
private readonly ISpeckleApplication _speckleApplication;

public RhinoBasicConnectorBinding(
DocumentModelStore store,
IBrowserBridge parent,
ISendConversionCache sendConversionCache,
ISpeckleApplication speckleApplication
)
{
_store = store;
Parent = parent;
_sendConversionCache = sendConversionCache;
_speckleApplication = speckleApplication;
Commands = new BasicConnectorBindingCommands(parent);

_store.DocumentChanged += (_, _) =>
parent.TopLevelExceptionHandler.FireAndForget(async () =>
{
await Commands.NotifyDocumentChanged().ConfigureAwait(false);
// Note: this prevents scaling issues when copy-pasting from one rhino doc to another in the same session.
_sendConversionCache.ClearCache();
});
}

Expand Down
Loading