mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-19 16:26:40 +08:00
Fixed flip x/y for root bone. (reverse-merged from commit 64fd34ba9426e2c7637526b1029721000c14ad5b)
#43
This commit is contained in:
parent
be93cdd019
commit
3736352c09
@ -39,8 +39,8 @@ public class Bone {
|
||||
_worldScaleY = _parent._worldScaleY * scaleY;
|
||||
_worldRotation = _parent._worldRotation + rotation;
|
||||
} else {
|
||||
_worldX = flipX ? -x : x;
|
||||
_worldY = flipY ? -y : y;
|
||||
_worldX = x;
|
||||
_worldY = y;
|
||||
_worldScaleX = scaleX;
|
||||
_worldScaleY = scaleY;
|
||||
_worldRotation = rotation;
|
||||
|
||||
@ -66,8 +66,8 @@ void Bone_updateWorldTransform (Bone* self, int flipX, int flipY) {
|
||||
CONST_CAST(float, self->worldScaleY) = self->parent->worldScaleY * self->scaleY;
|
||||
CONST_CAST(float, self->worldRotation) = self->parent->worldRotation + self->rotation;
|
||||
} else {
|
||||
CONST_CAST(float, self->worldX) = flipX ? -self->x : self->x;
|
||||
CONST_CAST(float, self->worldY) = flipY ? -self->y : self->y;
|
||||
CONST_CAST(float, self->worldX) = self->x;
|
||||
CONST_CAST(float, self->worldY) = self->y;
|
||||
CONST_CAST(float, self->worldScaleX) = self->scaleX;
|
||||
CONST_CAST(float, self->worldScaleY) = self->scaleY;
|
||||
CONST_CAST(float, self->worldRotation) = self->rotation;
|
||||
|
||||
@ -65,8 +65,8 @@ namespace Spine {
|
||||
WorldScaleY = parent.WorldScaleY * ScaleY;
|
||||
WorldRotation = parent.WorldRotation + Rotation;
|
||||
} else {
|
||||
WorldX = flipX ? -X : X;
|
||||
WorldY = flipY ? -Y : Y;
|
||||
WorldX = X;
|
||||
WorldY = Y;
|
||||
WorldScaleX = ScaleX;
|
||||
WorldScaleY = ScaleY;
|
||||
WorldRotation = Rotation;
|
||||
|
||||
@ -44,8 +44,8 @@ spine.Bone.prototype = {
|
||||
this.worldScaleY = parent.worldScaleY * this.scaleY;
|
||||
this.worldRotation = parent.worldRotation + this.rotation;
|
||||
} else {
|
||||
this.worldX = flipX ? -this.x : this.x;
|
||||
this.worldY = flipY ? -this.y : this.y;
|
||||
this.worldX = this.x;
|
||||
this.worldY = this.y;
|
||||
this.worldScaleX = this.scaleX;
|
||||
this.worldScaleY = this.scaleY;
|
||||
this.worldRotation = this.rotation;
|
||||
|
||||
@ -73,8 +73,8 @@ public class Bone {
|
||||
worldScaleY = parent.worldScaleY * scaleY;
|
||||
worldRotation = parent.worldRotation + rotation;
|
||||
} else {
|
||||
worldX = flipX ? -x : x;
|
||||
worldY = flipY ? -y : y;
|
||||
worldX = x;
|
||||
worldY = y;
|
||||
worldScaleX = scaleX;
|
||||
worldScaleY = scaleY;
|
||||
worldRotation = rotation;
|
||||
|
||||
@ -42,16 +42,8 @@ function Bone.new (data, parent)
|
||||
self.worldScaleY = parent.worldScaleY * self.scaleY
|
||||
self.worldRotation = parent.worldRotation + self.rotation
|
||||
else
|
||||
if flipX then
|
||||
self.worldX = -self.x
|
||||
else
|
||||
self.worldX = self.x
|
||||
end
|
||||
if flipY then
|
||||
self.worldY = -self.y
|
||||
else
|
||||
self.worldY = self.y
|
||||
end
|
||||
self.worldX = self.x
|
||||
self.worldY = self.y
|
||||
self.worldScaleX = self.scaleX
|
||||
self.worldScaleY = self.scaleY
|
||||
self.worldRotation = self.rotation
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user