* Get the width of this line. * @return The width of the line. */
| 153 | * @return The width of the line. |
| 154 | */ |
| 155 | int FallbackParagraphLayout::FallbackLine::GetWidth() const |
| 156 | { |
| 157 | if (this->empty()) return 0; |
| 158 | |
| 159 | /* |
| 160 | * The last X position of a run contains is the end of that run. |
| 161 | * Since there is no left-to-right support, taking this value of |
| 162 | * the last run gives us the end of the line and thus the width. |
| 163 | */ |
| 164 | const auto &run = this->GetVisualRun(this->CountRuns() - 1); |
| 165 | const auto &positions = run.GetPositions(); |
| 166 | if (positions.empty()) return 0; |
| 167 | return positions.back().right + 1; |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Get the number of runs in this line. |
no test coverage detected