r/javaScriptStudyGroup • • May 15 '16

Check out my latest CodPen!

http://codepen.io/ForScale/full/rebPvL
2 Upvotes

28 comments sorted by

View all comments

1

u/ForScale May 15 '16

Just a fun idea to start playing around with!

Definitely needs some work on the ux side of things...

2

u/Volv May 15 '16

lol. Codpen, So thats a bit random :)

1

u/ForScale May 15 '16

Lol! I think I saw somebody write that once, CodPen; they just forgot the e, obviously. But upon reading it I had the funny idea of a cod being used as a pen. So... today I implemented it!

I'm gonna build it up as a drawing application. I'll add in the ability to change pen size and color and some other goodies!

2

u/Volv May 16 '16

Looking forward to seeing what you add.
And at the risk of being annoying :) - My approach

1

u/ForScale May 17 '16 edited May 17 '16

Lol! NOT ANNOYING! :)

But... I don't think it's working for me... The code makes sense and on a quick scan I can see what it's supposed to be doing, but I'm just getting a black canvas/screen. It's never drawing a blue line for me... I'll take an in depth look later on to see if I can get it working!

Not at all sure what was wrong the first time I was playing with it, but I threw in a few alerts to make sure all the handler functions were working and now the drawing is working! I have no way to explain that...

I like the outsideCanvas thing. That's a great idea!

Using Chrome, btw.

*and lol, you didn't steal mousemove from me. It's like saying you stole var from me! :)

2

u/Volv May 17 '16 edited May 17 '16

So it only seems to fail for me after a resize. Even when I try to reattatch the listener after resize. Don't know why.
Comment out resize function = fixed :)
 
Can now change colours. Also pressing Ctrl and clicking will draw a single pixel atm.

1

u/ForScale May 17 '16

Nice! Yep, I resized it the first time before trying it. Interesting that that breaks it...