(index int)
| 2677 | } |
| 2678 | |
| 2679 | func (label *Label) IndexInLine(index int) int { |
| 2680 | cp := index |
| 2681 | for _, line := range label.RendererResult.TextLines { |
| 2682 | if cp <= len(line)-1 { |
| 2683 | return cp |
| 2684 | } |
| 2685 | cp -= len(line) |
| 2686 | } |
| 2687 | return len(label.RendererResult.TextLines[len(label.RendererResult.TextLines)-1]) |
| 2688 | } |
| 2689 | |
| 2690 | func (label *Label) LineNumber(textIndex int) int { |
| 2691 | cp := textIndex |