MGraphicsAnimHost
Transparent single-child wrapper the widget factory inserts around every node an animation targets. Layout-transparent always: it reports the child's desired size and hands the child a rect of its full allotted size. Animation
- Module
- MiriGraphics
- Header
#include "MiriGraphics/Widgets/MGraphicsAnimHost.h"- Namespace
Miri
Public functions
| Returns | Name | Description |
|---|---|---|
MiriVec2 | ComputeDesiredSize | |
void | ArrangeChildren | |
int32_t | OnPaint | |
const char* | GetTypeName | |
bool | CanCacheDesiredSize | |
bool | CanSkipArrange | |
bool | CanRetainPaint | |
void | OnMouseEnter | |
void | OnMouseLeave | |
void | SetHoverCallback | |
void | SetAnimTranslationX | |
void | SetAnimTranslationY | |
void | SetAnimScale | |
void | SetAnimOpacity | |
void | SetAnimRotation | |
void | ResetAnimState | |
MiriVec2 | GetAnimTranslation | |
float | GetAnimScale | |
float | GetAnimOpacity | |
float | GetAnimRotation | |
MiriMat3 | BuildRotationMatrix | Rotation about the child's centre, in absolute pixels. |
MiriMat3 | BuildRenderTransform | Scale then rotation about the child's centre; identity at rest. |
bool | HasRenderTransform | |
void | SetDesignUnitScale | The design-pixel → viewport-pixel factor translations are multiplied by. |
float | GetDesignUnitScale | |
float | ResolveDesignUnitScale | The scale of the screen root this host sits under, so two stacks of different sizes (split screen, a second PIE window) never share one value. |
Function details
ComputeDesiredSize
MiriVec2 ComputeDesiredSize(float scale) const overrideArrangeChildren
void ArrangeChildren(const CGeometry& geo) overrideOnPaint
int32_t OnPaint(const CMiriPaintArgs& args, const CGeometry& geo, CMiriRenderer& renderer, int32_t layerId) const overrideGetTypeName
const char* GetTypeName() const overrideCanCacheDesiredSize
bool CanCacheDesiredSize() const overrideCanSkipArrange
bool CanSkipArrange() const overrideCanRetainPaint
bool CanRetainPaint() const overrideOnMouseEnter
void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseLeave
void OnMouseLeave(const CPointerEvent& event) overrideSetHoverCallback
void SetHoverCallback(std::function<void(bool)> callback)SetAnimTranslationX
void SetAnimTranslationX(float designUnits)SetAnimTranslationY
void SetAnimTranslationY(float designUnits)SetAnimScale
void SetAnimScale(float scale)SetAnimOpacity
void SetAnimOpacity(float opacity)SetAnimRotation
void SetAnimRotation(float degrees)ResetAnimState
void ResetAnimState()GetAnimTranslation
MiriVec2 GetAnimTranslation() constGetAnimScale
float GetAnimScale() constGetAnimOpacity
float GetAnimOpacity() constGetAnimRotation
float GetAnimRotation() constBuildRotationMatrix
MiriMat3 BuildRotationMatrix(const CGeometry& childGeo) constRotation about the child's centre, in absolute pixels. Identity while the rotation track is at zero, which is what keeps the untouched UI on the renderer's no-transform fast path.
BuildRenderTransform
MiriMat3 BuildRenderTransform(const CGeometry& childGeo) constScale then rotation about the child's centre; identity at rest.
HasRenderTransform
bool HasRenderTransform() constSetDesignUnitScale
static void SetDesignUnitScale(float scale)The design-pixel → viewport-pixel factor translations are multiplied by. The screen-root canvas writes it at the top of every arrange pass, so hosts below it read the value of the screen they belong to.
GetDesignUnitScale
static float GetDesignUnitScale()ResolveDesignUnitScale
float ResolveDesignUnitScale() constThe scale of the screen root this host sits under, so two stacks of different sizes (split screen, a second PIE window) never share one value.