Author Topic: Scroll View Contents Not Drawn Correctly  (Read 6161 times)

kromenak

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Scroll View Contents Not Drawn Correctly
« on: January 21, 2014, 10:18:52 PM »
This is similar to, and maybe the same issue, as outlined here: http://www.tasharen.com/forum/index.php?topic=7422.msg35043#msg35043.  I'm using 3.0.8 f3; I can update to the latest if you think it will help, but I didn't see anything about this in the change logs.

Basically, when I animate the position of a panel (adjusting it's localPosition) that has a scroll view in it (to move a panel off-screen, for example), the contents of the scroll view will occasionally disappear.  If I view the panel in editor after this occurs, I can see that the contents of the panel appear to be missing.  The "Draw Call Tool" shows that the panel has "No draw calls found".

I'm finding that three things can potentially fix the issue:
  • If you move the contents of the scroll view by dragging it, the contents reappear.
  • If I disable the panel before animating it, and then enable the panel, it appears that the contents refresh and show.
  • If I adjust the panel's clipping center/size data, the panel contents reappear.

In the case of #3, I find that in script, all that really matters is that mResize be set to true; this seems to recalculate the clipping area and show the panel contents properly.  From what I can gather, it seems that maybe moving the scroll view is causing the clipping region to get messed up somehow, which is fixed by forcing a resize event on the panel.

It seems to be a bug to me, but please let me know if I'm doing something wrong as well!


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Scroll View Contents Not Drawn Correctly
« Reply #1 on: January 22, 2014, 02:03:43 AM »
Please update to the latest first. This issue was already fixed.

kromenak

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Re: Scroll View Contents Not Drawn Correctly
« Reply #2 on: January 23, 2014, 02:38:19 PM »
Hmm, I just updated to 3.0.9f4 and I'm seeing the same issue, though it seems less consistent.

I'm finding that adjusting the panel's clipping size will (so far) always resolve the issue.  More specifically, it seems that setting mResized to true causes some sort of recalculation that fixes the issue.

EDIT: Actually I think the cause of this was that when I switched over to the "UI" camera event type, I made the following change:
  • DraggablePanel
    • Button1 (collider w/ UIWidget)
    • Button2 (collider w/ UIWidget)
  • DragPanelContents

My buttons have a collider on their top level that is used for input - problem was, with "UI" type camera, all the input was being eaten up by the DragPanelContents, so I added UIWidget components to my buttons to give them higher UI input priority.

I think the dimensions of the UIWidget components was causing something weird to occur...I swapped so that the DragPanelContents has a low-priority UIWidget on it, and took the UIWidget components off of the buttons.  This seems to work much better, but I'll let you know if I run into the issue again.