2019-03-13 18:49:00 +00:00
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image/color"
|
|
|
|
|
|
|
|
"opslag.de/schobers/geom"
|
|
|
|
)
|
|
|
|
|
|
|
|
type DrawOptions struct {
|
2020-05-23 06:20:04 +00:00
|
|
|
Source *geom.RectangleF32
|
|
|
|
Tint color.Color
|
2019-03-13 18:49:00 +00:00
|
|
|
}
|
2020-05-15 07:20:44 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|