aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNigel Tao <nigeltao@golang.org>2010-12-16 15:11:10 +1100
committerNigel Tao <nigeltao@golang.org>2010-12-16 15:11:10 +1100
commit0bf2aa1aa77b1280f4ad42779a3d4dcc74dab259 (patch)
tree240bf25b3923ad9e452a438686ce8fed457722dd
parent319ab4782ca7894cf2c4cfc64b9c09598bca07ed (diff)
downloadgo-0bf2aa1aa77b1280f4ad42779a3d4dcc74dab259.tar.gz
go-0bf2aa1aa77b1280f4ad42779a3d4dcc74dab259.zip
exp/draw: remove Border function.
It was only used by exp/4s, and even if it is general purpose, I think it belongs in a graphics library atop exp/draw, not in exp/draw itself. R=rsc CC=golang-dev https://golang.org/cl/3705041
-rw-r--r--src/pkg/exp/draw/draw.go23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/pkg/exp/draw/draw.go b/src/pkg/exp/draw/draw.go
index c94ae83a42..1d0729d922 100644
--- a/src/pkg/exp/draw/draw.go
+++ b/src/pkg/exp/draw/draw.go
@@ -361,26 +361,3 @@ func drawRGBA(dst *image.RGBA, r image.Rectangle, src image.Image, sp image.Poin
}
}
}
-
-// Border aligns r.Min in dst with sp in src and then replaces pixels
-// in a w-pixel border around r in dst with the result of the Porter-Duff compositing
-// operation ``src over dst.'' If w is positive, the border extends w pixels inside r.
-// If w is negative, the border extends w pixels outside r.
-func Border(dst Image, r image.Rectangle, w int, src image.Image, sp image.Point) {
- i := w
- if i > 0 {
- // inside r
- Draw(dst, image.Rect(r.Min.X, r.Min.Y, r.Max.X, r.Min.Y+i), src, sp) // top
- Draw(dst, image.Rect(r.Min.X, r.Min.Y+i, r.Min.X+i, r.Max.Y-i), src, sp.Add(image.Pt(0, i))) // left
- Draw(dst, image.Rect(r.Max.X-i, r.Min.Y+i, r.Max.X, r.Max.Y-i), src, sp.Add(image.Pt(r.Dx()-i, i))) // right
- Draw(dst, image.Rect(r.Min.X, r.Max.Y-i, r.Max.X, r.Max.Y), src, sp.Add(image.Pt(0, r.Dy()-i))) // bottom
- return
- }
-
- // outside r;
- i = -i
- Draw(dst, image.Rect(r.Min.X-i, r.Min.Y-i, r.Max.X+i, r.Min.Y), src, sp.Add(image.Pt(-i, -i))) // top
- Draw(dst, image.Rect(r.Min.X-i, r.Min.Y, r.Min.X, r.Max.Y), src, sp.Add(image.Pt(-i, 0))) // left
- Draw(dst, image.Rect(r.Max.X, r.Min.Y, r.Max.X+i, r.Max.Y), src, sp.Add(image.Pt(r.Dx(), 0))) // right
- Draw(dst, image.Rect(r.Min.X-i, r.Max.Y, r.Max.X+i, r.Max.Y+i), src, sp.Add(image.Pt(-i, 0))) // bottom
-}