Add toggle button for grid snapping.
This commit is contained in:
@@ -30,6 +30,7 @@ namespace FlaxEditor.Windows.Assets
|
||||
private readonly ToolStripButton _saveButton;
|
||||
private readonly ToolStripButton _undoButton;
|
||||
private readonly ToolStripButton _redoButton;
|
||||
private readonly ToolStripButton _gridSnapButton;
|
||||
private bool _showWholeGraphOnLoad = true;
|
||||
|
||||
/// <summary>
|
||||
@@ -68,8 +69,9 @@ namespace FlaxEditor.Windows.Assets
|
||||
_undo.ActionDone += OnUndoRedo;
|
||||
|
||||
// Toolstrip
|
||||
SurfaceUtils.VisjectCommonToolstripSetup(editor, _toolstrip, _undo, Save, ShowWholeGraph, InputActions,
|
||||
out _saveButton, out _undoButton, out _redoButton);
|
||||
SurfaceUtils.VisjectCommonToolstripSetup(editor, _toolstrip, _undo,
|
||||
Save, ShowWholeGraph, ToggleGridSnap, InputActions,
|
||||
out _saveButton, out _undoButton, out _redoButton, out _gridSnapButton);
|
||||
|
||||
// Panel
|
||||
_panel = new Panel(ScrollBars.None)
|
||||
@@ -94,6 +96,11 @@ namespace FlaxEditor.Windows.Assets
|
||||
_surface.ShowWholeGraph();
|
||||
}
|
||||
|
||||
private void ToggleGridSnap()
|
||||
{
|
||||
SurfaceUtils.ToggleSurfaceGridSnap(_surface, _gridSnapButton);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes temporary asset to see changes live when editing the surface.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user