Lesh_M

  • 2022년 10월 16일
  • 2022년 10월 16일에 가입함
  • I added skin atlas repacking and encountered an issue where some of my regions weren't being rotated properly.
    This is the problematic code:

    // \Spine\Runtime\spine-sharp\Atlas.cs
    if (region.degrees == 90) {
       region.u2 = (region.x + region.height) / (float)page.width;
       region.v2 = (region.y + region.width) / (float)page.height;
    
       (region.packedWidth, region.packedHeight) = (region.packedHeight, region.packedWidth);
    } else {
       region.u2 = (region.x + region.width) / (float)page.width;
       region.v2 = (region.y + region.height) / (float)page.height;
    }
    

    if I change this:

    if (region.degrees == 90)

    to this:

    if (region.degrees is 90 or 270)

    it works properly, and ideas?

    P.S
    I attached a minimal project extracted from my main one to reproduce the bug.
    It also writes log warnings for the 3 regions that aren't rotated.
    Just run it and you'll understand everything.