Unverified Commit 151331bc authored by Jeremy Soller's avatar Jeremy Soller Committed by GitHub

Merge pull request #51 from robbycerantola/master

fix getpixel()
parents 757c0de0 185001db
......@@ -693,7 +693,7 @@ pub trait Renderer {
///Gets pixel color at x,y position
fn getpixel(&self, x:i32, y:i32) -> Color {
let p = (self.width()as i32 * y + x) as usize;
if p > self.data().len() {
if p >= self.data().len() {
return Color::rgba(0,0,0,0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment