Patterned rectangles now render properly
This commit is contained in:
parent
cfb08f02bc
commit
3acbe40665
@ -38,6 +38,7 @@ func FillRectangle (
|
|||||||
updatedRegion image.Rectangle,
|
updatedRegion image.Rectangle,
|
||||||
) {
|
) {
|
||||||
data, stride := destination.Buffer()
|
data, stride := destination.Buffer()
|
||||||
|
realWidth, realHeight := bounds.Dx(), bounds.Dy()
|
||||||
bounds = bounds.Canon().Intersect(destination.Bounds()).Canon()
|
bounds = bounds.Canon().Intersect(destination.Bounds()).Canon()
|
||||||
if bounds.Empty() { return }
|
if bounds.Empty() { return }
|
||||||
updatedRegion = bounds
|
updatedRegion = bounds
|
||||||
@ -46,7 +47,7 @@ func FillRectangle (
|
|||||||
for y := 0; y < height; y ++ {
|
for y := 0; y < height; y ++ {
|
||||||
for x := 0; x < width; x ++ {
|
for x := 0; x < width; x ++ {
|
||||||
data[x + bounds.Min.X + (y + bounds.Min.Y) * stride] =
|
data[x + bounds.Min.X + (y + bounds.Min.Y) * stride] =
|
||||||
source.AtWhen(x, y, width, height)
|
source.AtWhen(x, y, realWidth, realHeight)
|
||||||
}}
|
}}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user