andydandy74 / Monito

A view extension for the Dynamo visual programming environment
MIT License
17 stars 4 forks source link

[Global] Better zooming #12

Closed andydandy74 closed 5 years ago

andydandy74 commented 6 years ago

Need to get the width and height of the target objects in order to properly calculate the zoom factor

andydandy74 commented 6 years ago

As per Mike's advice, let's try selections again to circumvent the scaling issues with annotations.

var dynamoSelection = typeof (DynamoModel).Assembly.GetType("DynamoSelection");
var selectionInstance = dynamoSelection.GetProperty("Instance", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
var clearMethod = dynamoSelection.GetMethod("ClearSelection", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public);
clearMethod.Invoke(selectionInstance.GetValue(null), null);