Skip to content

Commit b124302

Browse files
committed
[refactor] Do not use values returned by pi.ClipReset()
pi.ClipReset() returns 4 parameters which is a lot. Use pi.Scr().Clip() instead to get a struct with clipping region.
1 parent 2aa977a commit b124302

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

devtools/control.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ func pauseGame() {
3535
}
3636
gamePaused = true
3737

38-
pi.Camera.Reset()
39-
x, y, w, h := pi.ClipReset()
40-
4138
stateCopy = stateWhenGameWasPaused{
4239
time: pi.Time,
4340
camera: pi.Camera,
44-
clip: pi.Region{X: x, Y: y, W: w, H: h},
41+
clip: pi.Scr().Clip(),
4542
}
4643

44+
pi.Camera.Reset()
45+
pi.ClipReset()
46+
4747
snapshot.Take()
4848
}
4949

0 commit comments

Comments
 (0)