Rename method

This commit is contained in:
Bartłomiej Dach 2024-05-29 10:04:49 +02:00
parent ba40737356
commit 9bd4b0d613
No known key found for this signature in database
1 changed files with 10 additions and 8 deletions

View File

@ -137,21 +137,23 @@ private void updateAxisCheckBoxesEnabled()
{
if (scaleInfo.Value.Origin == ScaleOrigin.PlayfieldCentre)
{
setBindableEnabled(true, xCheckBox.Current);
setBindableEnabled(true, yCheckBox.Current);
toggleAxisAvailable(xCheckBox.Current, true);
toggleAxisAvailable(yCheckBox.Current, true);
}
else
{
setBindableEnabled(scaleHandler.CanScaleX.Value, xCheckBox.Current);
setBindableEnabled(scaleHandler.CanScaleY.Value, yCheckBox.Current);
toggleAxisAvailable(xCheckBox.Current, scaleHandler.CanScaleX.Value);
toggleAxisAvailable(yCheckBox.Current, scaleHandler.CanScaleY.Value);
}
}
private void setBindableEnabled(bool enabled, Bindable<bool> current)
private void toggleAxisAvailable(Bindable<bool> axisBindable, bool available)
{
current.Disabled = false; // enable the bindable to allow setting the value
current.Value = enabled;
current.Disabled = !enabled;
// enable the bindable to allow setting the value
axisBindable.Disabled = false;
// restore the presumed default value given the axis's new availability state
axisBindable.Value = available;
axisBindable.Disabled = !available;
}
private void updateMaxScale()