AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AScrollAreaViewport Class Reference

Inner component of AScrollArea that manages rendering and event handling with custom offset (scroll). More...

#include <AUI/View/AScrollAreaViewport.h>

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.

Member Function Documentation

> All members, including inherited

◆ applyGeometryToChildren()

void AScrollAreaViewport::applyGeometryToChildren ( )
overridevirtual

See Layout Managers for more info.

Reimplemented from AViewContainerBase.

◆ compensateLayoutUpdatesByScroll()

template<aui::invocable ApplyLayoutUpdate>
void AScrollAreaViewport::compensateLayoutUpdatesByScroll ( _< AView > anchor,
ApplyLayoutUpdate && applyLayoutUpdate,
glm::ivec2 diffMask = glm::ivec2(1, 1) )
Parameters
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.

◆ consumesClick()

bool AScrollAreaViewport::consumesClick ( const glm::ivec2 & pos)
inlineoverridevirtual
Parameters
posmouse position
Returns
true if AView processes this click

Used in AViewContainer::getViewAt method subset, thus affecting click event handling.

Reimplemented from AView.