should work now
This commit is contained in:
@@ -306,6 +306,29 @@ namespace FlaxEditor.CustomEditors.Dedicated
|
|||||||
return;
|
return;
|
||||||
SetValue(control.Tag);
|
SetValue(control.Tag);
|
||||||
}
|
}
|
||||||
|
/// <inheritdoc/>
|
||||||
|
protected override void SynchronizeValue(object value)
|
||||||
|
{
|
||||||
|
// Custom anchors editing for Control to handle bounds preservation via key modifiers
|
||||||
|
if (ParentEditor != null)
|
||||||
|
{
|
||||||
|
var centerToPosition = Input.GetKey(KeyboardKeys.Shift);
|
||||||
|
var setPivot = Input.GetKey(KeyboardKeys.Control);
|
||||||
|
var editedAny = false;
|
||||||
|
foreach (var parentValue in ParentEditor.Values)
|
||||||
|
{
|
||||||
|
if (parentValue is Control parentControl)
|
||||||
|
{
|
||||||
|
parentControl.SetAnchorPreset((AnchorPresets)value, centerToPosition, setPivot);
|
||||||
|
editedAny = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (editedAny)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
base.SynchronizeValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Refresh()
|
public override void Refresh()
|
||||||
|
|||||||
17
Source/Engine/UI/GUI/Control.Bounds.cs.rej
Normal file
17
Source/Engine/UI/GUI/Control.Bounds.cs.rej
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
diff a/Source/Engine/UI/GUI/Control.Bounds.cs b/Source/Engine/UI/GUI/Control.Bounds.cs (rejected hunks)
|
||||||
|
@@ -485,13 +485,13 @@
|
||||||
|
|
||||||
|
_anchorMin = anchorMin;
|
||||||
|
_anchorMax = anchorMax;
|
||||||
|
- if (preserveBounds)
|
||||||
|
+ if (!centerToPosition)
|
||||||
|
{
|
||||||
|
UpdateBounds();
|
||||||
|
Bounds = bounds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- if (!preserveBounds)
|
||||||
|
+ if (centerToPosition)
|
||||||
|
{
|
||||||
|
if (_parent != null)
|
||||||
|
{
|
||||||
@@ -193,7 +193,7 @@ namespace FlaxEngine.GUI
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
set => SetAnchorPreset(value, Input.GetKey(KeyboardKeys.Shift), Input.GetKey(KeyboardKeys.Control));
|
set => SetAnchorPreset(value, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user