mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[libgdx] Moved duplicate code outside the IF.
This commit is contained in:
parent
65e8d12e63
commit
9d77b4bf12
@ -70,14 +70,12 @@ public class RegionAttachment extends Attachment {
|
|||||||
float localY = -localY2;
|
float localY = -localY2;
|
||||||
if (region instanceof AtlasRegion) {
|
if (region instanceof AtlasRegion) {
|
||||||
AtlasRegion region = (AtlasRegion)this.region;
|
AtlasRegion region = (AtlasRegion)this.region;
|
||||||
|
localX += region.offsetX / region.originalWidth * width;
|
||||||
|
localY += region.offsetY / region.originalHeight * height;
|
||||||
if (region.rotate) {
|
if (region.rotate) {
|
||||||
localX += region.offsetX / region.originalWidth * width;
|
|
||||||
localY += region.offsetY / region.originalHeight * height;
|
|
||||||
localX2 -= (region.originalWidth - region.offsetX - region.packedHeight) / region.originalWidth * width;
|
localX2 -= (region.originalWidth - region.offsetX - region.packedHeight) / region.originalWidth * width;
|
||||||
localY2 -= (region.originalHeight - region.offsetY - region.packedWidth) / region.originalHeight * height;
|
localY2 -= (region.originalHeight - region.offsetY - region.packedWidth) / region.originalHeight * height;
|
||||||
} else {
|
} else {
|
||||||
localX += region.offsetX / region.originalWidth * width;
|
|
||||||
localY += region.offsetY / region.originalHeight * height;
|
|
||||||
localX2 -= (region.originalWidth - region.offsetX - region.packedWidth) / region.originalWidth * width;
|
localX2 -= (region.originalWidth - region.offsetX - region.packedWidth) / region.originalWidth * width;
|
||||||
localY2 -= (region.originalHeight - region.offsetY - region.packedHeight) / region.originalHeight * height;
|
localY2 -= (region.originalHeight - region.offsetY - region.packedHeight) / region.originalHeight * height;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user