cursorBBox returns a bounding-box for a cursor at given position
(pos lexer.Pos)
| 74 | |
| 75 | // cursorBBox returns a bounding-box for a cursor at given position |
| 76 | func (ed *Editor) cursorBBox(pos lexer.Pos) image.Rectangle { |
| 77 | cpos := ed.charStartPos(pos) |
| 78 | cbmin := cpos.SubScalar(ed.CursorWidth.Dots) |
| 79 | cbmax := cpos.AddScalar(ed.CursorWidth.Dots) |
| 80 | cbmax.Y += ed.fontHeight |
| 81 | curBBox := image.Rectangle{cbmin.ToPointFloor(), cbmax.ToPointCeil()} |
| 82 | return curBBox |
| 83 | } |
| 84 | |
| 85 | // renderCursor renders the cursor on or off, as a sprite that is either on or off |
| 86 | func (ed *Editor) renderCursor(on bool) { |
no test coverage detected