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

Method renderRegionToEnd

texteditor/render.go:341–351  ·  view source on GitHub ↗

renderRegionToEnd renders a region in given style and background, to end of line from start

(st lexer.Pos, sty *styles.Style, bg image.Image)

Source from the content-addressed store, hash-verified

339
340// renderRegionToEnd renders a region in given style and background, to end of line from start
341func (ed *Editor) renderRegionToEnd(st lexer.Pos, sty *styles.Style, bg image.Image) {
342 spos := ed.charStartPosVisible(st)
343 epos := spos
344 epos.Y += ed.lineHeight
345 vsz := epos.Sub(spos)
346 if vsz.X <= 0 || vsz.Y <= 0 {
347 return
348 }
349 pc := &ed.Scene.PaintContext
350 pc.FillBox(spos, epos.Sub(spos), bg) // same line, done
351}
352
353// renderAllLines displays all the visible lines on the screen,
354// after PushBounds has already been called.

Callers 1

renderDepthBackgroundMethod · 0.95

Calls 3

charStartPosVisibleMethod · 0.95
FillBoxMethod · 0.80
SubMethod · 0.45

Tested by

no test coverage detected