> home > Custom Layer Boundary API

view_line_y_difference

January 19th 2020
Compute the signed vertical pixel distance between the top of two lines

Signature

C++
f32
view_line_y_difference(Application_Links* app,
                       View_ID view_id,
                       i64 line_a,
                       i64 line_b);

Parameters

app

the standard custom layer context pointer

view_id

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

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 view exists and contains both given line numbers

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.