DrawOffset
This commit is contained in:
@@ -95,6 +95,13 @@ func (w *RelativeLayout) Draw(screen tcell.Screen) {
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
func (w *RelativeLayout) DrawOffset(c Coord, screen tcell.Screen) {
|
||||
p := w.GetPos()
|
||||
w.SetPos(p.Add(c))
|
||||
w.Draw(screen)
|
||||
w.SetPos(p)
|
||||
}
|
||||
func (w *RelativeLayout) Active() bool { return w.active }
|
||||
func (w *RelativeLayout) SetActive(a bool) { w.active = a }
|
||||
func (w *RelativeLayout) Visible() bool { return w.visible }
|
||||
@@ -140,10 +147,10 @@ func (w *RelativeLayout) MinH() int {
|
||||
}
|
||||
|
||||
func (w *RelativeLayout) Add(n Widget, relTo Widget, relation RelativeRelation) {
|
||||
w.widgetRelations[n] = widgetRelation{
|
||||
w.widgetRelations[n] = append(w.widgetRelations[n], widgetRelation{
|
||||
relation: relation,
|
||||
relTo: relTo,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (w *RelativeLayout) AddRelation(n Widget, relation RelativeRelation, relTo Widget) {
|
||||
|
||||
Reference in New Issue
Block a user