Fix circle-size based scale being applied twice to caught fruit

Closes #22968.
This commit is contained in:
Dean Herbert 2023-03-29 18:03:21 +09:00
parent c0e60a0699
commit 836c884aae
1 changed files with 5 additions and 1 deletions

View File

@ -136,6 +136,7 @@ public Catcher(DroppedObjectContainer droppedObjectTarget, IBeatmapDifficultyInf
Origin = Anchor.TopCentre; Origin = Anchor.TopCentre;
Size = new Vector2(BASE_SIZE); Size = new Vector2(BASE_SIZE);
if (difficulty != null) if (difficulty != null)
Scale = calculateScale(difficulty); Scale = calculateScale(difficulty);
@ -333,8 +334,11 @@ protected override void Update()
base.Update(); base.Update();
var scaleFromDirection = new Vector2((int)VisualDirection, 1); var scaleFromDirection = new Vector2((int)VisualDirection, 1);
body.Scale = scaleFromDirection; body.Scale = scaleFromDirection;
caughtObjectContainer.Scale = hitExplosionContainer.Scale = flipCatcherPlate ? scaleFromDirection : Vector2.One; // Inverse of catcher scale is applied here, as catcher gets scaled by circle size and so do the incoming fruit.
caughtObjectContainer.Scale = (1 / Scale.X) * (flipCatcherPlate ? scaleFromDirection : Vector2.One);
hitExplosionContainer.Scale = flipCatcherPlate ? scaleFromDirection : Vector2.One;
// Correct overshooting. // Correct overshooting.
if ((hyperDashDirection > 0 && hyperDashTargetPosition < X) || if ((hyperDashDirection > 0 && hyperDashTargetPosition < X) ||