freetype-go: Fix panic when drawing a span to the right of the

bounding rect.

This bug was introduced when an image.RGBA's representation went from
slice of slices to one linear buffer.

R=r
CC=golang-dev
http://codereview.appspot.com/2020044
This commit is contained in:
Nigel Tao 2010-08-27 10:51:14 +10:00
parent 6a75ac002d
commit 29c473cb3e
1 changed files with 3 additions and 0 deletions

View File

@ -105,6 +105,9 @@ func (r *RGBAPainter) Paint(ss []Span, done bool) {
if s.X1 > b.Max.X {
s.X1 = b.Max.X
}
if s.X0 >= s.X1 {
continue
}
base := s.Y * r.Image.Stride
p := r.Image.Pix[base+s.X0 : base+s.X1]
for i, rgba := range p {