|
ttx 0.1.0
|
Represents the result of reflowing a RowGroup. More...
#include <ttx/terminal/reflow_result.h>
Public Member Functions | |
| void | add_offset (AbsolutePosition position, i64 dr, i32 dc, bool absolute_column=false) |
| Add an offset for the given position to map to new coordinates. | |
| void | merge (ReflowResult &&other) |
| Merge another reflow result with this one. | |
| auto | map_position (AbsolutePosition position) const -> AbsolutePosition |
| Map a provided position into the new coordinate space. | |
| auto | operator== (ReflowResult const &) const -> bool=default |
Friends | |
| constexpr friend auto | tag_invoke (di::Tag< di::reflect >, di::InPlaceType< ReflowResult >) |
Represents the result of reflowing a RowGroup.
Reflow is the process of adjusting the text in a row group to fit into a different number of columns. This process can add or remove rows to a row group, as well as change the column offset of text within a row which was reflowed.
The reflow result describes how to map a absolute position from before the reflow operation to the correct coordinates after the reflow. This result is described in terms of delta's which apply to a certain range of coordinates. This means that looking up the offset to apply to a given position can be done using a binary search. Only the start of each range is recorded in the result, so the end of the range is implied by the start of the next range.
| void ttx::terminal::ReflowResult::add_offset | ( | AbsolutePosition | position, |
| i64 | dr, | ||
| i32 | dc, | ||
| bool | absolute_column = false ) |
Add an offset for the given position to map to new coordinates.
| auto ttx::terminal::ReflowResult::map_position | ( | AbsolutePosition | position | ) | const -> AbsolutePosition |
Map a provided position into the new coordinate space.
| void ttx::terminal::ReflowResult::merge | ( | ReflowResult && | other | ) |
Merge another reflow result with this one.
|
default |
|
friend |