> home > Custom Layer Boundary API

view_set_preferred_x

September 8th 2024
Set the preferred x on a view

Signature

C++
b32
view_set_preferred_x(Application_Links* app,
                     View_ID view_id,
                     f32 x);

Parameters

app

the standard custom layer context pointer

view_id

the id of the view to modify

x

the new preferred x coordinate

Return

non-zero if the view exists, zero otherwise

Details

the preferred x is used to keep a cursor aligned as closely as possible to a particular x-coordinate durring vertical movements