forked from joejulian/gio
all: use new rectangle and point convenience functions
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-6
@@ -5,7 +5,6 @@ package layout
|
||||
import (
|
||||
"image"
|
||||
|
||||
"gioui.org/f32"
|
||||
"gioui.org/op"
|
||||
)
|
||||
|
||||
@@ -175,7 +174,7 @@ func (f Flex) Layout(gtx *Context, children ...FlexChild) {
|
||||
}
|
||||
var stack op.StackOp
|
||||
stack.Push(gtx.Ops)
|
||||
op.TransformOp{}.Offset(toPointF(axisPoint(f.Axis, mainSize, cross))).Add(gtx.Ops)
|
||||
op.TransformOp{}.Offset(FPt(axisPoint(f.Axis, mainSize, cross))).Add(gtx.Ops)
|
||||
child.macro.Add()
|
||||
stack.Pop()
|
||||
mainSize += axisMain(f.Axis, dims.Size)
|
||||
@@ -252,10 +251,6 @@ func axisConstraints(a Axis, mainMin, mainMax, crossMin, crossMax int) Constrain
|
||||
}
|
||||
}
|
||||
|
||||
func toPointF(p image.Point) f32.Point {
|
||||
return f32.Point{X: float32(p.X), Y: float32(p.Y)}
|
||||
}
|
||||
|
||||
func (s Spacing) String() string {
|
||||
switch s {
|
||||
case SpaceEnd:
|
||||
|
||||
Reference in New Issue
Block a user