Author Topic: Texture/Sprite Corners visibility bug  (Read 107 times)

Eugene

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
Texture/Sprite Corners visibility bug
« on: February 15, 2017, 01:45:56 PM »
I believe it's not the way it's supposed to work:
http://clip2net.com/s/3Hyx7He

The problem place is (UIBasicSprite::981).
This bit:
  1. if ((y == 0 && bottomType != AdvancedType.Invisible) || (y == 2 && topType != AdvancedType.Invisible) ||
  2.       (x == 0 && leftType != AdvancedType.Invisible) || (x == 2 && rightType != AdvancedType.Invisible))
Should be changed to this:
  1. bool show = true;
  2.         if (y == 0 && bottomType == AdvancedType.Invisible)
  3.             show = false;
  4.         if (y == 2 && topType == AdvancedType.Invisible)
  5.             show = false;
  6.         if (x == 0 && leftType == AdvancedType.Invisible)
  7.             show = false;
  8.         if (x == 2 && rightType == AdvancedType.Invisible)
  9.             show = false;
  10.  
  11.                     if (show)
  12.      {

And then it should work as it should. Please, add it to next NGUI patch.
Cheers.

mdeletrain

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 70
    • View Profile
Re: Texture/Sprite Corners visibility bug
« Reply #1 on: February 16, 2017, 05:58:31 AM »
I may be wrong but I think this is the same as :

  1.     if ((y != 0 || bottomType != AdvancedType.Invisible) && (y != 2 || topType != AdvancedType.Invisible) &&
  2.           (x != 0 || leftType != AdvancedType.Invisible) && (x != 2 || rightType != AdvancedType.Invisible))

So to keep initial form... but it's less readable.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 261
  • -Receive: 1125
  • Posts: 21,784
  • Toronto, Canada
    • View Profile
Re: Texture/Sprite Corners visibility bug
« Reply #2 on: February 18, 2017, 07:04:19 PM »
I think you mean...
  1.                                         if (y == 0 && bottomType == AdvancedType.Invisible) continue;
  2.                                         if (y == 2 && topType == AdvancedType.Invisible) continue;
  3.                                         if (x == 0 && leftType == AdvancedType.Invisible) continue;
  4.                                         if (x == 2 && rightType == AdvancedType.Invisible) continue;
  5.  
  6.                                         Fill(verts, uvs, cols,
  7.                                                 mTempPos[x].x, mTempPos[x2].x,
  8.                                                 mTempPos[y].y, mTempPos[y2].y,
  9.                                                 mTempUVs[x].x, mTempUVs[x2].x,
  10.                                                 mTempUVs[y].y, mTempUVs[y2].y, c);
I've ran into this before myself and always thought to myself, "well it has been this way since the beginning... why change it now?". I can see how the current approach can cause some confusion though, seeing as there is no way to explicitly hide corners.

Eugene

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: Texture/Sprite Corners visibility bug
« Reply #3 on: February 19, 2017, 01:15:04 PM »
@ArenMook, yeah. As long as I can keep ngui changes in my project to the minimum, it works for me. Thanks!