From 193fbae4bf5560d982ff8eb3f061b7b2f7d13242 Mon Sep 17 00:00:00 2001 From: SrtHero278 Date: Sat, 20 Apr 2024 15:14:49 -0700 Subject: [PATCH] fix charPos not displaying position and scale properly --- .../editors/stage/elements/StageCharacterButton.hx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/funkin/editors/stage/elements/StageCharacterButton.hx b/source/funkin/editors/stage/elements/StageCharacterButton.hx index f23d6fe4..d74e8834 100644 --- a/source/funkin/editors/stage/elements/StageCharacterButton.hx +++ b/source/funkin/editors/stage/elements/StageCharacterButton.hx @@ -28,9 +28,14 @@ class StageCharacterButton extends StageElementButton { public override function updateInfo() { char.visible = !isHidden; char.alpha = 0.5 * charPos.alpha; - charPos.scale.x = char.scale.x; - charPos.scale.y = char.scale.y; + var charScale = (char.xml.has.scale ? Std.parseFloat(char.xml.att.scale).getDefault(1) : 1); + charPos.scale.x = char.scale.x / charScale; + charPos.scale.y = char.scale.y / charScale; + charPos.x = char.x; + charPos.y = char.y; + char.scale.copyFrom(charPos.scale); super.updateInfo(); + char.scale.scale(charScale); } public override function getSprite():FunkinSprite {