本文整理匯總了Golang中github.com/achille-roussel/go-vu/geom.Rect.Y方法的典型用法代碼示例。如果您正苦於以下問題:Golang Rect.Y方法的具體用法?Golang Rect.Y怎麽用?Golang Rect.Y使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/achille-roussel/go-vu/geom.Rect
的用法示例。
在下文中一共展示了Rect.Y方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Layout
func (self VerticalLayout) Layout(bounds geom.Rect, widgets ...Widget) {
n := len(widgets)
bounds.H -= float64(n-1) * self.Spacing
bounds.H /= float64(n)
for _, w := range widgets {
w.SetBounds(bounds)
bounds.Y += bounds.H + self.Spacing
}
}
示例2: redraw
func redraw(widget Widget, bounds geom.Rect) {
if view, ok := widget.(*View); ok {
view.redraw(bounds)
return
}
if parent := widget.Parent(); parent != nil {
r := parent.Bounds()
bounds.X += r.X
bounds.Y += r.Y
redraw(parent, bounds)
return
}
}
示例3: SetBounds
func (self *Frame) SetBounds(bounds geom.Rect) {
self.Control.SetBounds(bounds)
bounds.X = 0
bounds.Y = 0
self.Layout().Layout(bounds, self.Children()...)
}
示例4: RedrawRect
func RedrawRect(widget Widget, rect geom.Rect) {
bounds := widget.Bounds()
rect.X += bounds.X
rect.Y += bounds.Y
redraw(widget, rect)
}