[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-dev] resize on views within a scrollview?
On 16 Dec 2009, at 14:48, ronald kuivila wrote:
Hi Scott,
I don't understand the problem. If you use a resize option the view
is constrained to the outer bounds of its containing view. If you set
the bounds of
that contained view with external logic, it might expand the internal
bounds of the containing scrollview to contain it, but it would be
forced back to within
the external bounds on a refresh.
Sorry Ron, I'll try to be clearer. I think there are two ways of
approaching this (to be honest, I'm not sure which, if any, you're
proposing):
1. The resize is in relation to the bounds of the visible portion of
the scrollview (its 'viewport' as Sciss calls it).
2. The resize is in relation to the bounds of the scrollview's
internal canvas (it's internal bounds).
Both I think have edge cases that need clarification.
1. is weird because the changing the visible bounds doesn't
necessarily change the internal bounds. It works okay as long as the
internal bounds and visible bounds are the same for the axis on which
a view is resizing. If the internal bounds are greater, it gets weird.
Imagine I have a view which is vertically resized but is not currently
visible because the vertical axis of the internal bounds exceeds that
of the visible bounds. How should it behave when I change the visible
bounds? If that view itself changes the size of the internal bounds by
growing, it could then in turn change the position of other views
depending on how they are anchored. It's easy to imagine that this
behaviour will not be predictable.
2. Is a problem for a similar reason. The internal bounds change
automatically when either the visible bounds or the bounds of
contained views change. Again unpredictable results.
Does that make sense? I'm also worried that resizing loops might
result in some cases and hang the app.
If this requires significantly more than propagating the resize, I am
fine with leaving it as is and using the UserView hack.
If I'm just being dense, and this really is simple (always a
possibility!), then by all means go ahead and do it.
In any case, I don't think it would be much trouble to implement a
callback. I can have a go in a couple of days if you think that's
useful.
S.
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/