diff options
| author | faiface <faiface@ksp.sk> | 2017-08-20 12:49:52 +0200 |
|---|---|---|
| committer | faiface <faiface@ksp.sk> | 2017-08-20 12:49:52 +0200 |
| commit | 5ecc83c6bc073eba1530d5d302f295cbc9d306fd (patch) | |
| tree | 1cffdc8626d977e9607020aa9343f14585a7aab2 | |
| parent | 2e0803f55cdce11017d0d5ddd8d5937bbfd29220 (diff) | |
| download | gui-5ecc83c6bc073eba1530d5d302f295cbc9d306fd.zip | |
layout: remove Sub
| -rw-r--r-- | layout/sub.go | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/layout/sub.go b/layout/sub.go deleted file mode 100644 index 70531c7..0000000 --- a/layout/sub.go +++ /dev/null @@ -1,37 +0,0 @@ -package layout - -import ( - "image" - - "github.com/faiface/gui/event" -) - -func NewSub(eif EventImageFlusher, r image.Rectangle) *Sub { - s := &Sub{ - eif: eif, - } - s.Event("resize", func(evt string) bool { - var x1, y1, x2, y2 int - event.Sscan(evt, &x1, &y1, &x2, &y2) - r := image.Rect(x1, y1, x2, y2) - s.sub = eif.Image().SubImage(r).(*image.RGBA) - return false - }) - s.Happen(event.Sprint("resize", r.Min.X, r.Min.Y, r.Max.X, r.Max.Y)) - return s -} - -type Sub struct { - event.Dispatch - eif EventImageFlusher - sub *image.RGBA -} - -func (s *Sub) Image() *image.RGBA { - return s.sub -} - -func (s *Sub) Flush(r image.Rectangle) { - r = s.sub.Bounds().Intersect(r) - s.eif.Flush(r) -} |