mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-13 22:47:26 +01:00
internal/restorable: early return for an empty rectangle
This commit is contained in:
parent
90562ee84b
commit
47f19da710
@ -28,6 +28,9 @@ type pixelsRecord struct {
|
|||||||
|
|
||||||
func (p *pixelsRecord) clearIfOverlapped(rect image.Rectangle) {
|
func (p *pixelsRecord) clearIfOverlapped(rect image.Rectangle) {
|
||||||
r := p.rect.Intersect(rect)
|
r := p.rect.Intersect(rect)
|
||||||
|
if r.Empty() {
|
||||||
|
return
|
||||||
|
}
|
||||||
ox := r.Min.X - p.rect.Min.X
|
ox := r.Min.X - p.rect.Min.X
|
||||||
oy := r.Min.Y - p.rect.Min.Y
|
oy := r.Min.Y - p.rect.Min.Y
|
||||||
w := p.rect.Dx()
|
w := p.rect.Dx()
|
||||||
|
Loading…
Reference in New Issue
Block a user