Fix CanvasScaler point projection when using location offset

This commit is contained in:
2026-07-28 22:27:45 +02:00
parent 4ba22b4fa8
commit 1bc66192db
+4 -2
View File
@@ -460,15 +460,17 @@ namespace FlaxEngine.GUI
{
var result = base.PointToParent(ref location);
result *= _scale;
result += Location * (1 - _scale); // Cancel-out scaling of the location in parent space
return result;
}
/// <inheritdoc />
public override Float2 PointFromParent(ref Float2 location)
{
var result = base.PointFromParent(ref location);
// Reverse PointToParent
var result = location - Location * (1 - _scale);
result /= _scale;
return result;
return base.PointFromParent(ref result);
}
#endregion