summaryrefslogtreecommitdiff
path: root/test/main.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-11 13:54:50 -0400
committerPietro Gagliardi <[email protected]>2014-04-11 16:13:18 -0400
commit6f0d114a8b2557e89a56480ed5f69edd3853b282 (patch)
tree38159c7e87bc952233df8cc9c51cfe282d92e30c /test/main.go
parent179ddba93a0c1ab2aed0825d2ecc27b291099723 (diff)
Changed from using image.NRGBA to image.RGBA (premultiplied alpha) in Area.Paint() since it'll be easier to work with on Windows after applying what Treeki/Ninjifox suggested I do instead of what I am doing now.
Diffstat (limited to 'test/main.go')
-rw-r--r--test/main.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/main.go b/test/main.go
index 7397cc6..348f082 100644
--- a/test/main.go
+++ b/test/main.go
@@ -147,18 +147,18 @@ func invalidTest(c *Combobox, l *Listbox, s *Stack, g *Grid) {
var invalidBefore = flag.Bool("invalid", false, "run invalid test before opening window")
type areaHandler struct {
- img *image.NRGBA
+ img *image.RGBA
}
-func (a *areaHandler) Paint(rect image.Rectangle) *image.NRGBA {
+func (a *areaHandler) Paint(rect image.Rectangle) *image.RGBA {
//fmt.Println(rect)
/*
- req.Out <- img[i].SubImage(req.Rect).(*image.NRGBA)
+ req.Out <- img[i].SubImage(req.Rect).(*image.RGBA)
if lastrect != req.Rect {
lastrect = req.Rect
i = 1 - i
}
*/
- return a.img.SubImage(rect).(*image.NRGBA)
+ return a.img.SubImage(rect).(*image.RGBA)
}
func (a *areaHandler) Mouse(e MouseEvent) bool {
fmt.Printf("%#v\n", e)
@@ -186,7 +186,7 @@ func areaTest() {
if err != nil {
panic(err)
}
- img := image.NewNRGBA(ximg.Bounds())
+ img := image.NewRGBA(ximg.Bounds())
draw.Draw(img, img.Rect, ximg, image.ZP, draw.Over)
w := NewWindow("Area Test", 100, 100)
a := NewArea(320, 240, &areaHandler{
@@ -231,7 +231,7 @@ func areaTest() {
var areabounds = flag.Bool("areabounds", false, "run area bounds test instead")
func areaboundsTest() {
- img := image.NewNRGBA(image.Rect(0, 0, 320, 240))
+ img := image.NewRGBA(image.Rect(0, 0, 320, 240))
a := NewArea(320, 240, &areaHandler{
img: img,
})