> home > Custom Layer Boundary API

buffer_line_shift_y

September 8th 2024
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
buffer_line_shift_y(Application_Links* app,
                    Buffer_ID buffer_id,
                    f32 width,
                    Face_ID face_id,
                    i64 line,
                    f32 y_shift);

Parameters

app

the standard custom layer context pointer

buffer_id

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

width

the width parameter of the layout, passed to layout rules as a recommended wrap point

face_id

the face parameter of the layout, passed to layout rules as a recommended face

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 buffer exists and contains the line, cleared to zero otherwise

Details

Line numbers are 1 based.

Related

Line_Shift_Vertical