Skip to content

Commit

Permalink
graphic helpers - 2.19 hotfix (#14425)
Browse files Browse the repository at this point in the history
* 2.19 hotfix

- graphic scale units not taking effect in Dynamo - added check to disable host settings interfering with Dynamo settings
- renamed resource for Show Grid to Show Helpers

* revert menu item change

- revert menu item name change, will move it to Master instead

* line endings

* fix units overriding grid visibility

- setting scale units would override the visibility of the grid
- now checks the grid, and if disabled, toggles it back to the correct setting
  • Loading branch information
dnenov authored Sep 22, 2023
1 parent 62477a1 commit 854f50d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using Dynamo.Wpf.ViewModels.Core.Converters;
using DynamoUtilities;
using ViewModels.Core;
using static Dynamo.Configuration.Configurations;
using Res = Dynamo.Wpf.Properties.Resources;

namespace Dynamo.ViewModels
Expand Down Expand Up @@ -195,7 +194,7 @@ public string SelectedUnits
selectedUnits = value;
RaisePropertyChanged(nameof(SelectedUnits));

if (UseHostScaleUnits) return;
if (UseHostScaleUnits && IsDynamoRevit) return;

var result = Enum.TryParse(selectedUnits, out Configurations.Units currentUnit);
if (!result) return;
Expand All @@ -206,6 +205,14 @@ public string SelectedUnits
preferenceSettings.GraphicScaleUnit = value;
preferenceSettings.GridScaleFactor = (float)units;
dynamoViewModel.UpdateGraphicHelpersScaleCommand.Execute(null);

// We have turn the grid visilibilty on
// Check the current visibility settings, and turn it back off
if (!preferenceSettings.IsBackgroundGridVisible)
{
dynamoViewModel.ToggleBackgroundGridVisibilityCommand.Execute(null); // switch 'on'
dynamoViewModel.ToggleBackgroundGridVisibilityCommand.Execute(null); // switch 'off'
}
}
}
}
Expand Down

0 comments on commit 854f50d

Please sign in to comment.