mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/restorable: refactoring
This commit is contained in:
parent
0f4066e7ac
commit
8de08295e9
@ -34,10 +34,10 @@ func (p *pixelsRecord) readPixels(pixels []byte, region image.Rectangle, imageWi
|
||||
|
||||
dstBaseX := r.Min.X - region.Min.X
|
||||
dstBaseY := r.Min.Y - region.Min.Y
|
||||
srcBaseX := r.Min.X - p.rect.Min.X
|
||||
srcBaseY := r.Min.Y - p.rect.Min.Y
|
||||
lineWidth := 4 * r.Dx()
|
||||
if p.pix != nil {
|
||||
srcBaseX := r.Min.X - p.rect.Min.X
|
||||
srcBaseY := r.Min.Y - p.rect.Min.Y
|
||||
for j := 0; j < r.Dy(); j++ {
|
||||
dstX := 4 * ((dstBaseY+j)*region.Dx() + dstBaseX)
|
||||
srcX := 4 * ((srcBaseY+j)*p.rect.Dx() + srcBaseX)
|
||||
|
Loading…
Reference in New Issue
Block a user