Add Zoom value box to timeline view context menu

This commit is contained in:
Wojtek Figat
2021-08-10 17:27:44 +02:00
parent 14068307d1
commit 9c1fa7c0ce

View File

@@ -580,7 +580,7 @@ namespace FlaxEditor.GUI.Timeline
get => _zoom;
set
{
value = Mathf.Clamp(value, 0.0001f, 1000.0f);
value = Mathf.Clamp(value, 0.00001f, 1000.0f);
if (Mathf.NearEqual(_zoom, value))
return;
@@ -1040,6 +1040,13 @@ namespace FlaxEditor.GUI.Timeline
menu.AddButton("Show preview values", () => ShowPreviewValues = !ShowPreviewValues).Checked = ShowPreviewValues;
{
var zoom = menu.AddButton("Zoom");
var zoomValue = new FloatValueBox(Zoom, 140, 2, 50.0f, 0.00001f, 1000.0f, 0.001f);
zoomValue.Parent = zoom;
zoomValue.ValueChanged += () => Zoom = zoomValue.Value;
}
OnShowViewContextMenu(menu);
menu.Show(_viewButton.Parent, _viewButton.BottomLeft);