AScrollAreaViewport#
Inner component of AScrollArea that manages rendering and event handling with custom offset (scroll).
| Header: | #include <AUI/View/AScrollAreaViewport.h> |
| CMake: | aui_link(my_target PUBLIC aui::views) |
Detailed Description#
This view is intended to store only one single view with setContents()/contents() methods.
This view does not handle scroll events and touch events related to scroll. Use AScrollArea for such case.
Expanding contents fill the viewport#
A child set via setContents() that has ass::Expanding will always occupy at least the full viewport size
on the expanding axis. The scrollable surface size (setScrollSurfaceSize) acts as a lower bound; the viewport's
own size acts as another lower bound — the child receives max(scrollSurfaceSize, viewportSize). This means an
expanding widget fills the visible area instead of collapsing to its minimum content size.
Prefer AScrollArea over using this class directly.
Examples#
Public Types#
Inner#
class AScrollAreaViewport::Inner
Empty structure.
Public Methods#
compensateLayoutUpdatesByScroll#
template<aui::invocable ApplyLayoutUpdate >
void AScrollAreaViewport::compensateLayoutUpdatesByScroll(_<AView> anchor, ApplyLayoutUpdate&& applyLayoutUpdate, glm::ivec2 diffMask = glm::ivec2(1, 1))
Compensates layout updates made in applyLayoutUpdate by scrolling by a diff of relative position of anchor.
- Arguments
anchordirect or indirect child used as an anchor.applyLayoutUpdatelayout update procedure.diffMaskmask that is used to control axes of the compensation. Default is `{1, 1}`.
Helps preventing visual layout jittering by querying relative to AScrollAreaViewport position of anchor before and after applyLayoutUpdate. The diff of relative position is then used to scroll the viewport, maintaining consistent visual position of anchor.
anchor must be direct or indirect child to this AScrollAreaViewport before and after applyLayoutUpdate.
The scroll operation made within this method does not prevent scroll animation nor kinetic effects.