[TASK] Fixed a bug in movePointeR().
This commit is contained in:
parent
bc5b7aeabd
commit
9eebcddb84
|
@ -111,11 +111,11 @@ class BoxImage {
|
||||||
//if we go back
|
//if we go back
|
||||||
if($step === -1) {
|
if($step === -1) {
|
||||||
//decrease x-pointer
|
//decrease x-pointer
|
||||||
$this->pointer_x--;
|
$this->pointer_x -= 1;
|
||||||
//handle y-jumps
|
//handle y-jumps
|
||||||
if($this->pointer_x === 0) {
|
if($this->pointer_x < 0) {
|
||||||
$this->pointer_x = $width;
|
$this->pointer_x = $width;
|
||||||
$this->pointer_y--;
|
$this->pointer_y -= 1;
|
||||||
//out of range?
|
//out of range?
|
||||||
if($this->pointer_y < 0) throw new Exception("Out of range! (width)");
|
if($this->pointer_y < 0) throw new Exception("Out of range! (width)");
|
||||||
}
|
}
|
||||||
|
@ -123,11 +123,11 @@ class BoxImage {
|
||||||
//if we go forward
|
//if we go forward
|
||||||
} elseif($step === 1) {
|
} elseif($step === 1) {
|
||||||
//increase x-pointer
|
//increase x-pointer
|
||||||
$this->pointer_x++;
|
$this->pointer_x += 1;
|
||||||
//handle y-jumps
|
//handle y-jumps
|
||||||
if($this->pointer_x === $this->width) {
|
if($this->pointer_x > $this->width) {
|
||||||
$this->pointer_x = 0;
|
$this->pointer_x = 0;
|
||||||
$this->pointer_y++;
|
$this->pointer_y += 1;
|
||||||
//out of range?
|
//out of range?
|
||||||
if($this->pointer_y > $this->height) throw new Exception("Out of range! (height)");
|
if($this->pointer_y > $this->height) throw new Exception("Out of range! (height)");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue