summaryrefslogtreecommitdiff
path: root/area.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-29 19:02:09 -0400
committerPietro Gagliardi <[email protected]>2014-03-29 19:02:09 -0400
commitefdd60375ab3048919bde2d5f410b92626a6a712 (patch)
tree0ea30f1113217bcf6111dc0ce015f2d43388b86a /area.go
parent652797bd3e3c374620f75aa2bea2ee3534396ab8 (diff)
Documented that the clip area in AreaHandler.Paint() more properly and indicate that it is cleared on each AreaHandler.Paint() call; (try to) implement that on Windows (GTK+ does it for us; noted that as well).
Diffstat (limited to 'area.go')
-rw-r--r--area.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/area.go b/area.go
index 05d3361..1fbaa28 100644
--- a/area.go
+++ b/area.go
@@ -37,6 +37,8 @@ type Area struct {
// (Having to use this interface does not strike me as being particularly Go-like, but the nature of Paint makes channel-based event handling a non-option; in practice, deadlocks occur.)
type AreaHandler interface {
// Paint is called when the Area needs to be redrawn.
+ // The part of the Area that needs to be redrawn is stored in cliprect.
+ // Before Paint() is called, this region is cleared with a system-defined background color.
// You MUST handle this event, and you MUST return a valid image, otherwise deadlocks and panicking will occur.
// The image returned must have the same size as rect (but does not have to have the same origin points).
// Example:
@@ -48,7 +50,7 @@ type AreaHandler interface {
// func (h *myAreaHandler) Paint(rect image.Rectangle) *image.NRGBA {
// return img.SubImage(rect).(*image.NRGBA)
// }
- Paint(rect image.Rectangle) *image.NRGBA
+ Paint(cliprect image.Rectangle) *image.NRGBA
// Mouse is called when the Area receives a mouse event.
// You are allowed to do nothing in this handler (to ignore mouse events).