2017-02-22 13:44:38 -06:00
|
|
|
package pixelgl
|
|
|
|
|
|
|
|
import (
|
2017-03-05 17:28:52 -06:00
|
|
|
"math"
|
|
|
|
|
2017-02-22 13:44:38 -06:00
|
|
|
"github.com/faiface/pixel"
|
|
|
|
)
|
|
|
|
|
2017-03-07 10:45:46 -06:00
|
|
|
func intBounds(bounds pixel.Rect) (x, y, w, h int) {
|
2017-05-21 12:25:06 -05:00
|
|
|
x0 := int(math.Floor(bounds.Min.X))
|
|
|
|
y0 := int(math.Floor(bounds.Min.Y))
|
|
|
|
x1 := int(math.Ceil(bounds.Max.X))
|
|
|
|
y1 := int(math.Ceil(bounds.Max.Y))
|
2017-03-05 17:28:52 -06:00
|
|
|
return x0, y0, x1 - x0, y1 - y0
|
2017-02-22 13:44:38 -06:00
|
|
|
}
|