MCPcopy Create free account
hub / github.com/cogentcore/core / renderLineNumbersBoxAll

Method renderLineNumbersBoxAll

texteditor/render.go:418–432  ·  view source on GitHub ↗

renderLineNumbersBoxAll renders the background for the line numbers in the LineNumberColor

()

Source from the content-addressed store, hash-verified

416
417// renderLineNumbersBoxAll renders the background for the line numbers in the LineNumberColor
418func (ed *Editor) renderLineNumbersBoxAll() {
419 if !ed.hasLineNumbers {
420 return
421 }
422 pc := &ed.Scene.PaintContext
423 bb := ed.renderBBox()
424 spos := math32.Vector2FromPoint(bb.Min)
425 epos := math32.Vector2FromPoint(bb.Max)
426 epos.X = spos.X + ed.LineNumberOffset
427
428 sz := epos.Sub(spos)
429 pc.FillStyle.Color = ed.LineNumberColor
430 pc.DrawRoundedRectangle(spos.X, spos.Y, sz.X, sz.Y, ed.Styles.Border.Radius.Dots())
431 pc.Fill()
432}
433
434// renderLineNumber renders given line number; called within context of other render.
435// if defFill is true, it fills box color for default background color (use false for

Callers 1

renderAllLinesMethod · 0.95

Calls 6

renderBBoxMethod · 0.95
Vector2FromPointFunction · 0.92
DrawRoundedRectangleMethod · 0.80
FillMethod · 0.65
SubMethod · 0.45
DotsMethod · 0.45

Tested by

no test coverage detected