> home > Custom Layer Boundary API

view_line_shift_y

January 19th 2020
Compute a new line number and pixel shift relative to a given line number and pixel shift, guaranteeing that the new line number is the one closest to containing the new point

Signature

C++
Line_Shift_Vertical
view_line_shift_y(Application_Links* app,
                  View_ID view_id,
                  i64 line,
                  f32 y_shift);

Parameters

app

the standard custom layer context pointer

view_id

the id of the view who's layout will be measured

line

the line number of the line that serves as the relative starting point of the measurement

y_shift

the y shift, in pixels, from the top of the specified line to be measured

Return

the best match line number and the remaining y shift that is not accounted for by the change in line number on success, when the view exists and contains the line, cleared to zero otherwise

Details

Line numbers are 1 based.
Equivalent to calling the buffer related function of the same name by deriving the buffer, width, and face from the view.

Related

Line_Shift_Vertical