Anne van Kesteren

Sunday project: Paintr 2.0

I finally created my own Web 2.0 application. This is different from Web 2 applications, which are classified “pipedream” and not “beta.” Thanks to the Web2.0V2Logo Creatr Beta it has a logo too:

Paintr 2.0 Beta

Thanks to browser incompatibilities it only works in Opera 9 and secret internal builds at the moment. Perhaps it also works in Firefox 3, I haven’t tried. Anyway, Paintr 2.0 Beta is here for all your drawings, although I guess it’s more useful for sites accepting digital autographs, such as TransIP. (They are excellent. The only downside is their name; I keep forgetting it.)

I would appreciate feedback on my scripting style. What the best way of doing things is in ECMAScript is not always clear to me.

Comments

  1. Who need canvas? :P (very very alpha)

    Posted by Tino Zijdel at

  2. Apparently the problem is that Gecko doesn't support event.offsetX. The coordinate-related DOM is a mess.

    (Did I need to start the comment with xhtml doctype?)

    Posted by Nickolay Ponomarev at

  3. The Gecko bug is 69787.

    I've put a modified version there with some changes for computing the position of the canvas and then using clientX/Y. Hopefully, 174397 should make things easier.

    I changed the CSS because having a margin on the html element has no effect on the offsetLeft property of the body. I first thought it was a bug, but Opera behaves the same way, so I guess it's a design choice ;-).

    Posted by Sylvain at

  4. I think the easiest way to get it to work in firefox is using position:relative on the canvas element, and event.layerX/layerY instead of event.offsetX/offsetY.

    Posted by Jan de Mooij at

  5. Quite nice! I would suggest you to add this as Opera widget, even though we have much more advanced painter. ;)

    Posted by FataL at

  6. Anne this is uber cool. Can't live without it. Bye Bye MS Paint.

    Posted by olli at

  7. This app is great! I dumped photoshop to use this superior design studio instead! I even designed a house with it!

    Posted by Huib at

  8. Jan de Mooij: Thanks for the tip, how could I have missed that ;-). Now the changes are much smaller.

    Anne, feel free to apply the patch if you want Gecko compatibility.

    Posted by Sylvain at