[TASK] Fixed a bug in movePointeR().

This commit is contained in:
Jan Philipp Timme 2010-12-28 19:36:17 +00:00
parent bc5b7aeabd
commit 9eebcddb84
2 changed files with 6 additions and 6 deletions

View File

@ -111,11 +111,11 @@ class BoxImage {
//if we go back
if($step === -1) {
//decrease x-pointer
$this->pointer_x--;
$this->pointer_x -= 1;
//handle y-jumps
if($this->pointer_x === 0) {
if($this->pointer_x < 0) {
$this->pointer_x = $width;
$this->pointer_y--;
$this->pointer_y -= 1;
//out of range?
if($this->pointer_y < 0) throw new Exception("Out of range! (width)");
}
@ -123,11 +123,11 @@ class BoxImage {
//if we go forward
} elseif($step === 1) {
//increase x-pointer
$this->pointer_x++;
$this->pointer_x += 1;
//handle y-jumps
if($this->pointer_x === $this->width) {
if($this->pointer_x > $this->width) {
$this->pointer_x = 0;
$this->pointer_y++;
$this->pointer_y += 1;
//out of range?
if($this->pointer_y > $this->height) throw new Exception("Out of range! (height)");
}

BIN
test.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB