mirror of
https://github.com/ppy/osu
synced 2025-01-09 15:49:32 +00:00
Throw exception when not relatively positioned
This commit is contained in:
parent
9f92b3a8ba
commit
3a1587fa53
@ -92,12 +92,15 @@ namespace osu.Game.Graphics.Containers
|
|||||||
if (Logo == null)
|
if (Logo == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Logo.RelativePositionAxes != Axes.Both)
|
||||||
|
throw new InvalidOperationException($"Tracking logo must have {nameof(RelativePositionAxes)} = Axes.Both");
|
||||||
|
|
||||||
// Account for the scale of the actual OsuLogo, as SizeForFlow only accounts for the sprite scale.
|
// Account for the scale of the actual OsuLogo, as SizeForFlow only accounts for the sprite scale.
|
||||||
((ExposedFacade)LogoFacade).SetSize(new Vector2(Logo.SizeForFlow * Logo.Scale.X));
|
((ExposedFacade)LogoFacade).SetSize(new Vector2(Logo.SizeForFlow * Logo.Scale.X));
|
||||||
|
|
||||||
var localPos = ComputeLogoTrackingPosition();
|
var localPos = ComputeLogoTrackingPosition();
|
||||||
|
|
||||||
if (LogoFacade.Parent != null && Logo.Position != localPos && Logo.RelativePositionAxes == Axes.Both)
|
if (LogoFacade.Parent != null && Logo.Position != localPos)
|
||||||
{
|
{
|
||||||
// If this is our first update since tracking has started, initialize our starting values for interpolation
|
// If this is our first update since tracking has started, initialize our starting values for interpolation
|
||||||
if (startTime == null || startPosition == null)
|
if (startTime == null || startPosition == null)
|
||||||
|
Loading…
Reference in New Issue
Block a user