github.com/jmigpin/editor@v1.6.0/util/uiutil/widget/textscroll.go (about)

     1  package widget
     2  
     3  import (
     4  	"image"
     5  )
     6  
     7  type TextScroll struct {
     8  	*Text
     9  }
    10  
    11  //----------
    12  // Implement widget.Scrollable
    13  
    14  func (ts *TextScroll) ScrollOffset() image.Point {
    15  	return ts.Drawer.ScrollOffset()
    16  }
    17  
    18  func (ts *TextScroll) SetScrollOffset(o image.Point) {
    19  	if ts.Drawer.ScrollOffset() != o {
    20  		ts.Drawer.SetScrollOffset(o)
    21  		ts.MarkNeedsLayoutAndPaint()
    22  	}
    23  }
    24  
    25  func (ts *TextScroll) ScrollSize() image.Point {
    26  	return ts.Drawer.ScrollSize()
    27  }
    28  
    29  func (ts *TextScroll) ScrollViewSize() image.Point {
    30  	return ts.Drawer.ScrollViewSize()
    31  }
    32  
    33  func (ts *TextScroll) ScrollPageSizeY(up bool) int {
    34  	return ts.Drawer.ScrollPageSizeY(up)
    35  }
    36  
    37  func (ts *TextScroll) ScrollWheelSizeY(up bool) int {
    38  	return ts.Drawer.ScrollWheelSizeY(up)
    39  }