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

View File

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