Skip to content

Commit

Permalink
Matrix::setData
Browse files Browse the repository at this point in the history
  • Loading branch information
lastguest committed Mar 31, 2016
1 parent a05d7e3 commit 68f695d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Pixeler/Matrix.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public function __construct($width,$height){
$this->colors = new \SplFixedArray($this->csize);
}

public function setData(array $data) {
$this->matrix = \SplFixedArray::fromArray(array_slice($data,0,$this->size),false);
}

public function clearColors() {
$this->colors = new \SplFixedArray($this->csize);
}
Expand Down Expand Up @@ -117,4 +121,4 @@ public function __toString(){
return $this->render();
}

}
}

0 comments on commit 68f695d

Please sign in to comment.