Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Larry Young
4,356 PointsDrawing a single horizontal line using requestAnimationFrame();
I have some code that is working but for some reason I cannot control the length of the line. The code runs despite what the end point is set too, unless the y value is less than 2 above the start points why value. Here is a link to the JSFIddle.
I have setup a canvas for four other lines that I have also successfuly drawn but the same problem exists with those so I assume I am not understanding the logic behind what I've written.
If anyone has time to take a look at this fiddle and give me some advice I would greatly appreciate it. Thanks!