mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-02 21:59:09 +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;
|
_worldScaleY = _parent._worldScaleY * scaleY;
|
||||||
_worldRotation = _parent._worldRotation + rotation;
|
_worldRotation = _parent._worldRotation + rotation;
|
||||||
} else {
|
} else {
|
||||||
_worldX = flipX ? -x : x;
|
_worldX = x;
|
||||||
_worldY = flipY ? -y : y;
|
_worldY = y;
|
||||||
_worldScaleX = scaleX;
|
_worldScaleX = scaleX;
|
||||||
_worldScaleY = scaleY;
|
_worldScaleY = scaleY;
|
||||||
_worldRotation = rotation;
|
_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->worldScaleY) = self->parent->worldScaleY * self->scaleY;
|
||||||
CONST_CAST(float, self->worldRotation) = self->parent->worldRotation + self->rotation;
|
CONST_CAST(float, self->worldRotation) = self->parent->worldRotation + self->rotation;
|
||||||
} else {
|
} else {
|
||||||
CONST_CAST(float, self->worldX) = flipX ? -self->x : self->x;
|
CONST_CAST(float, self->worldX) = self->x;
|
||||||
CONST_CAST(float, self->worldY) = flipY ? -self->y : self->y;
|
CONST_CAST(float, self->worldY) = self->y;
|
||||||
CONST_CAST(float, self->worldScaleX) = self->scaleX;
|
CONST_CAST(float, self->worldScaleX) = self->scaleX;
|
||||||
CONST_CAST(float, self->worldScaleY) = self->scaleY;
|
CONST_CAST(float, self->worldScaleY) = self->scaleY;
|
||||||
CONST_CAST(float, self->worldRotation) = self->rotation;
|
CONST_CAST(float, self->worldRotation) = self->rotation;
|
||||||
|
|||||||
@ -65,8 +65,8 @@ namespace Spine {
|
|||||||
WorldScaleY = parent.WorldScaleY * ScaleY;
|
WorldScaleY = parent.WorldScaleY * ScaleY;
|
||||||
WorldRotation = parent.WorldRotation + Rotation;
|
WorldRotation = parent.WorldRotation + Rotation;
|
||||||
} else {
|
} else {
|
||||||
WorldX = flipX ? -X : X;
|
WorldX = X;
|
||||||
WorldY = flipY ? -Y : Y;
|
WorldY = Y;
|
||||||
WorldScaleX = ScaleX;
|
WorldScaleX = ScaleX;
|
||||||
WorldScaleY = ScaleY;
|
WorldScaleY = ScaleY;
|
||||||
WorldRotation = Rotation;
|
WorldRotation = Rotation;
|
||||||
|
|||||||
@ -44,8 +44,8 @@ spine.Bone.prototype = {
|
|||||||
this.worldScaleY = parent.worldScaleY * this.scaleY;
|
this.worldScaleY = parent.worldScaleY * this.scaleY;
|
||||||
this.worldRotation = parent.worldRotation + this.rotation;
|
this.worldRotation = parent.worldRotation + this.rotation;
|
||||||
} else {
|
} else {
|
||||||
this.worldX = flipX ? -this.x : this.x;
|
this.worldX = this.x;
|
||||||
this.worldY = flipY ? -this.y : this.y;
|
this.worldY = this.y;
|
||||||
this.worldScaleX = this.scaleX;
|
this.worldScaleX = this.scaleX;
|
||||||
this.worldScaleY = this.scaleY;
|
this.worldScaleY = this.scaleY;
|
||||||
this.worldRotation = this.rotation;
|
this.worldRotation = this.rotation;
|
||||||
|
|||||||
@ -73,8 +73,8 @@ public class Bone {
|
|||||||
worldScaleY = parent.worldScaleY * scaleY;
|
worldScaleY = parent.worldScaleY * scaleY;
|
||||||
worldRotation = parent.worldRotation + rotation;
|
worldRotation = parent.worldRotation + rotation;
|
||||||
} else {
|
} else {
|
||||||
worldX = flipX ? -x : x;
|
worldX = x;
|
||||||
worldY = flipY ? -y : y;
|
worldY = y;
|
||||||
worldScaleX = scaleX;
|
worldScaleX = scaleX;
|
||||||
worldScaleY = scaleY;
|
worldScaleY = scaleY;
|
||||||
worldRotation = rotation;
|
worldRotation = rotation;
|
||||||
|
|||||||
@ -42,16 +42,8 @@ function Bone.new (data, parent)
|
|||||||
self.worldScaleY = parent.worldScaleY * self.scaleY
|
self.worldScaleY = parent.worldScaleY * self.scaleY
|
||||||
self.worldRotation = parent.worldRotation + self.rotation
|
self.worldRotation = parent.worldRotation + self.rotation
|
||||||
else
|
else
|
||||||
if flipX then
|
self.worldX = self.x
|
||||||
self.worldX = -self.x
|
self.worldY = self.y
|
||||||
else
|
|
||||||
self.worldX = self.x
|
|
||||||
end
|
|
||||||
if flipY then
|
|
||||||
self.worldY = -self.y
|
|
||||||
else
|
|
||||||
self.worldY = self.y
|
|
||||||
end
|
|
||||||
self.worldScaleX = self.scaleX
|
self.worldScaleX = self.scaleX
|
||||||
self.worldScaleY = self.scaleY
|
self.worldScaleY = self.scaleY
|
||||||
self.worldRotation = self.rotation
|
self.worldRotation = self.rotation
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user