c# - What is "ITextViewLine.Top" property? -


The definition of top asset in MSDN is as follows:

Top position text rendering coordination system In the edge of this line

Definitions are a bit unclear when I consider the value returned by the top property of TextView in the Visual Studio Editor as negative,

how to interpret the "top" value ? Is there a reference point from where the "top" property value is calculated for each line?

ITextViewLine.Top this ITextView.ViewportTop Is the situation related to. When it can be negative for later signals:

The value can either be positive or negative when the viewport layout is only partially replaced, the viewportort is enhanced or the number of pixels Moves up or down so that the scene has been scrolled. When the viewport layout changes completely (such that all the lines in the previous layout change), the viewportstop is reset to 0.0.

In fact, you should understand that there is an abstract coordination system which is a part of all the lines. Scrolling in the editor is only moving your viewport within that coordinate system. Instead of "running" all the lines, some actions (such as inserting a new row at the beginning of the file), just insert another row on top with a negative header, and the viewport runs to it.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -