zntg/ui/drawoptions.go

20 lines
335 B
Go

package ui
import (
"image/color"
"opslag.de/schobers/geom"
)
type DrawOptions struct {
Tint color.Color
}
func ScaleToHeight(size geom.PointF32, height float32) (*geom.PointF32, float32) {
if size.Y == height {
return nil, size.X
}
factor := height / size.Y
return &geom.PointF32{X: factor, Y: factor}, factor * size.X
}