summaryrefslogtreecommitdiff
path: root/area.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 /area.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 'area.go')
-rw-r--r--area.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/area.go b/area.go
index d1c7420..91e1a3c 100644
--- a/area.go
+++ b/area.go
@@ -46,13 +46,13 @@ type AreaHandler interface {
// Example:
// imgFromFile, _, err := image.Decode(file)
// if err != nil { panic(err) }
- // img := image.NewNRGBA(imgFromFile.Rect)
+ // img := image.NewRGBA(imgFromFile.Rect)
// draw.Draw(img, img.Rect, imgFromFile, image.ZP, draw.Over)
// // ...
- // func (h *myAreaHandler) Paint(rect image.Rectangle) *image.NRGBA {
- // return img.SubImage(rect).(*image.NRGBA)
+ // func (h *myAreaHandler) Paint(rect image.Rectangle) *image.RGBA {
+ // return img.SubImage(rect).(*image.RGBA)
// }
- Paint(cliprect image.Rectangle) *image.NRGBA
+ Paint(cliprect image.Rectangle) *image.RGBA
// Mouse is called when the Area receives a mouse event.
// You are allowed to do nothing in this handler (to ignore mouse events).
@@ -328,10 +328,10 @@ func (a *Area) preferredSize() (width int, height int) {
}
// internal function, but shared by all system implementations: &img.Pix[0] is not necessarily the first pixel in the image
-func pixelDataPos(img *image.NRGBA) int {
+func pixelDataPos(img *image.RGBA) int {
return img.PixOffset(img.Rect.Min.X, img.Rect.Min.Y)
}
-func pixelData(img *image.NRGBA) *uint8 {
+func pixelData(img *image.RGBA) *uint8 {
return &img.Pix[pixelDataPos(img)]
}