Update pixel positions of the marked text area. */
| 309 | |
| 310 | /** Update pixel positions of the marked text area. */ |
| 311 | void Textbuf::UpdateMarkedText() |
| 312 | { |
| 313 | if (this->markend != 0) { |
| 314 | const auto pos = GetCharPosInString(this->buf, this->markpos, FS_NORMAL); |
| 315 | const auto end = GetCharPosInString(this->buf, this->markend, FS_NORMAL); |
| 316 | this->markxoffs = std::min(pos.left, end.left); |
| 317 | this->marklength = std::max(pos.right, end.right) - this->markxoffs; |
| 318 | } else { |
| 319 | this->markxoffs = this->marklength = 0; |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | /** |
| 324 | * Move to previous character position. |
no test coverage detected