ajduberstein/CatPicture — pull request #1 by harmonbc (2012-09-07 11:33:48+00:00)
Title: Code Review

The biggest issue was the potential program crash because of mouse clicks too close to the edge. The issue is fixed by adding parameter checking of the x1, y1, x2, y2 values in the drawLine() method.

Parameter checking is done by implementing 2 method checkWidth() and checkHeight() which returns a bool if it is in an acceptable range.

I conformed lines to 90 ch width.

Some for loops were using kTextureHeight instead of kAppWidth and kAppHeight. This will just cause unneeded pixel manipulation off the screen. This was fixed by implementing the correct param in the check statement.

Some function calls (ie in mouseClick. event.getX()) were repetative so I moved the value into a variable before other function calls needed to be made. This reduced about 35 function calls down to 2.