> home > Custom Layer Boundary API

buffer_line_y_difference

September 8th 2024
Compute the signed vertical pixel distance between the top of two lines

Signature

C++
f32
buffer_line_y_difference(Application_Links* app,
                         Buffer_ID buffer_id,
                         f32 width,
                         Face_ID face_id,
                         i64 line_a,
                         i64 line_b);

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_a

the line number of the line 'A' in the subtraction top(A) - top(B)

line_b

the line number of the line 'B' in the subtraction top(A) - top(B)

Return

the signed distance between the lines in pixels on success, when the buffer exists and contains both given line numbers

Details

Line numbers are 1 based.