[ts] 4.3 porting - Fixed slider scale.

This commit is contained in:
Davide Tantillo 2025-06-20 08:50:45 +02:00
parent f51db8f672
commit c99f5804d4
2 changed files with 6 additions and 5 deletions

View File

@ -320,15 +320,16 @@ export class SkeletonBinary {
data.local = (flags & 128) != 0;
data.bone = bones[input.readInt(true)];
let offset = input.readFloat();
let propertyScale = 1;
switch (input.readByte()) {
case 0: data.property = new FromRotate(); break;
case 1: {
offset *= scale;
propertyScale = scale;
data.property = new FromX();
break;
}
case 2: {
offset *= scale;
propertyScale = scale;
data.property = new FromY();
break;
}
@ -337,9 +338,9 @@ export class SkeletonBinary {
case 5: data.property = new FromShearY(); break;
default: continue;
};
data.property.offset = offset;
data.property.offset = offset * propertyScale;
data.offset = input.readFloat();
data.scale = input.readFloat();
data.scale = input.readFloat() / propertyScale;
}
constraints.push(data);
break;

View File

@ -346,7 +346,7 @@ export class SkeletonJson {
const propertyScale = this.propertyScale(property, scale);
data.property.offset = getValue(constraintMap, "from", 0) * propertyScale;
data.offset = getValue(constraintMap, "to", 0);
data.scale = getValue(constraintMap, "scale", 1);
data.scale = getValue(constraintMap, "scale", 1) / propertyScale;
data.local = getValue(constraintMap, "local", false);
}