Okay, let me explain more specifically.
We have the draggable panel vertically centered on the screen in the editor. It has an UIGrid element underneath, which is filled dynamically at runtime. This results in the first item in the UIGrid being in that middle of the screen position, which isn't what we want. So we adjust the position of the panel and move it up so that the middle of the UIGrid (CellCount/2) is showing in that center position. Since the clip area is still at the top of the panel, we adjust the clip area down to be at the center of the panel, but this results in the whole panel moving and the UIGrid isn't positioned in the middle anymore. We're kind of positive we're doing something the way it is not supposed to be done, hence the question about the preferred way of doing things.
And since (ASCII) images are worth more than thousand words, here's what we're trying to achieve (the number of cells can change, this is just to illustrate):
Legend: C = Clipped Grid Cell, G = Visible Grid Cell, [] = Draggable Panel
- Top of screen
[C]
[C]
[G]
[G] - Middle of screen
[G]
[C]
[C]
- Bottom of screen
And here is what we are getting by default:
- Top of Screen
[G] - Middle of screen
[G]
[G]
[C]
[C] - Bottom of screen
[C]
[C]
What we have after moving the panel:
- Top of screen
[G]
[G]
[G]
[C] - Middle of screen
[C]
[C]
[C]
- Bottom of screen
What we have after moving the clip area:
- Top of Screen
[C] - Middle of screen
[C]
[G]
[G]
[G] - Bottom of screen
[C]
[C]
If I recall correctly, trying to do the clipping area change first and the centering the panel after resulted in the clipping resetting to the top either when you started dragging or immediately, but if that is the correct order of doing this we have to examine what was actually happening again (the code for centering is currently commented out while we are working on snapping and wrapping for that panel as well).
Cheers,
-Tommi