Minor code cleanup #930

This commit is contained in:
Wojtek Figat
2023-02-09 09:47:27 +01:00
parent 7b253311a0
commit 45866e6771
2 changed files with 9 additions and 11 deletions

View File

@@ -78,7 +78,6 @@ namespace FlaxEditor.CustomEditors.Editors
/// <seealso cref="FlaxEditor.CustomEditors.Editors.Float3Editor" />
public class ScaleEditor : Float3Editor
{
private Image _linkImage;
/// <inheritdoc />
@@ -103,7 +102,10 @@ namespace FlaxEditor.CustomEditors.Editors
LinkedLabel.SetupContextMenu += (label, menu, editor) =>
{
menu.AddSeparator();
menu.AddButton(LinkValues ? "Unlink" : "Link", ToggleLink);
if (LinkValues)
menu.AddButton("Unlink", ToggleLink).LinkTooltip("Unlinks scale components from uniform scaling");
else
menu.AddButton("Link", ToggleLink).LinkTooltip("Links scale components for uniform scaling");
};
// Override colors

View File

@@ -97,7 +97,6 @@ namespace FlaxEditor.CustomEditors.Editors
return;
if (LinkValues)
_valueChanged = ValueChanged.X;
OnValueChanged();
}
@@ -107,7 +106,6 @@ namespace FlaxEditor.CustomEditors.Editors
return;
if (LinkValues)
_valueChanged = ValueChanged.Y;
OnValueChanged();
}
@@ -117,7 +115,6 @@ namespace FlaxEditor.CustomEditors.Editors
return;
if (LinkValues)
_valueChanged = ValueChanged.Z;
OnValueChanged();
}
@@ -150,8 +147,7 @@ namespace FlaxEditor.CustomEditors.Editors
xValue += valueChange;
yValue += valueChange;
break;
default:
break;
default: break;
}
}