mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-05 18:26:52 +08:00
[cpp] 4.0 porting, fix Atlas region UVs.
This commit is contained in:
parent
cf3a28e3a4
commit
3a503336bf
@ -337,14 +337,14 @@ void Atlas::load(const char *begin, int length, const char *dir, bool createText
|
|||||||
region->originalHeight = region->height;
|
region->originalHeight = region->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
region->u = region->x / page->width;
|
region->u = (float)region->x / page->width;
|
||||||
region->v = region->y / page->height;
|
region->v = (float)region->y / page->height;
|
||||||
if (region->degrees == 90) {
|
if (region->degrees == 90) {
|
||||||
region->u2 = (region->x + region->height) / page->width;
|
region->u2 = (float)(region->x + region->height) / page->width;
|
||||||
region->v2 = (region->y + region->width) / page->height;
|
region->v2 = (float)(region->y + region->width) / page->height;
|
||||||
} else {
|
} else {
|
||||||
region->u2 = (region->x + region->width) / page->width;
|
region->u2 = (float)(region->x + region->width) / page->width;
|
||||||
region->v2 = (region->y + region->height) / page->height;
|
region->v2 = (float)(region->y + region->height) / page->height;
|
||||||
}
|
}
|
||||||
_regions.add(region);
|
_regions.add(region);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user