github.com/jmigpin/editor@v1.6.0/util/drawutil/drawer4/earlyexit.go (about) 1 package drawer4 2 3 import "github.com/jmigpin/editor/util/mathutil" 4 5 type EarlyExit struct { 6 d *Drawer 7 } 8 9 func (ee *EarlyExit) Init() {} 10 11 func (ee *EarlyExit) Iter() { 12 maxY := mathutil.Intf1(ee.d.bounds.Max.Y) 13 14 // extra line iterated (not visible, useful for header1) 15 if ee.d.st.earlyExit.extraLine { 16 maxY += ee.d.lineHeight 17 } 18 19 if ee.d.st.runeR.pen.Y >= maxY { 20 ee.d.iterStop() 21 return 22 } 23 if !ee.d.iterNext() { 24 return 25 } 26 } 27 28 func (ee *EarlyExit) End() {}