| 519 | } |
| 520 | |
| 521 | void CUILines::DrawCursor(float x, float y) |
| 522 | { |
| 523 | float _h = m_pFont->CurrentHeight_(); |
| 524 | UI()->ClientToScreenScaledHeight(_h); |
| 525 | |
| 526 | float _w_tmp = 0; |
| 527 | |
| 528 | if (!m_text.empty()) |
| 529 | { |
| 530 | string4096 buff; |
| 531 | if (!uFlags.is(flComplexMode)) |
| 532 | { |
| 533 | strncpy_s(buff, m_text.c_str(), m_cursor_pos.x); |
| 534 | } |
| 535 | else |
| 536 | { |
| 537 | strcpy_s(buff, ""); |
| 538 | |
| 539 | CUILine line = m_lines[m_cursor_pos.y]; |
| 540 | |
| 541 | int sz = 0; |
| 542 | int size = line.m_subLines.size(); |
| 543 | for (int i = 0; i < size; i++) |
| 544 | { |
| 545 | const int line_size = (int)line.m_subLines[i].m_text.size(); |
| 546 | const char* line_text = line.m_subLines[i].m_text.c_str(); |
| 547 | |
| 548 | if (sz + line_size < m_cursor_pos.x) |
| 549 | { |
| 550 | strcat_s(buff, line_text); |
| 551 | sz += line_size; |
| 552 | } |
| 553 | else |
| 554 | { |
| 555 | strncat_s(buff, line_text, m_cursor_pos.x - sz); |
| 556 | break; |
| 557 | } |
| 558 | } |
| 559 | } |
| 560 | |
| 561 | buff[m_cursor_pos.x] = 0; |
| 562 | |
| 563 | _w_tmp = m_pFont->SizeOf_(buff); |
| 564 | } |
| 565 | |
| 566 | UI()->ClientToScreenScaledWidth(_w_tmp); |
| 567 | |
| 568 | Fvector2 outXY; |
| 569 | outXY.x = x + _w_tmp; |
| 570 | outXY.y = y + (_h + m_interval) * m_cursor_pos.y; |
| 571 | |
| 572 | UI()->ClientToScreenScaled(outXY); |
| 573 | |
| 574 | m_pFont->Out(outXY.x, outXY.y, "_"); |
| 575 | } |
| 576 | |
| 577 | void CUILines::Draw() |
| 578 | { |
nothing calls this directly
no test coverage detected