Skip to content

ui::CubicBezier

Header: winui/render/CubicBezier.hpp.

A cubic Bézier easing curve. The start and end anchors are fixed at (0,0) and (1,1), with the elapsed-time fraction in and the progress fraction out, both 0..1, so only the two interior control points are given. The default, easing::Linear, is a straight ramp, which is what BrushTransition always uses. ScalarTransition and Vector3Transition use a (0.8,0)-(0.2,1) curve. easing::ControlFastOutSlowIn is the curve the rest of the themed motion uses. Its control points (0,0)-(0,1) make it a pure decelerate, fast at the start and slow at the end.

Example:

const ui::CubicBezier ease_out{0.1f, 0.9f, 0.2f, 1.0f};
const float halfway = ui::easing::evaluate(ease_out, 0.5); // progress at half the time

Field Type Default
x1 float 0.0f The two interior control points, (x1,y1) and (x2,y2), each coordinate 0..1 (x is time, y is progress). The default is the linear ramp.
y1 float 0.0f
x2 float 1.0f
y2 float 1.0f