Skip to main content
GameDev.net gamedev.net
🔒 Locked

Problem with html5 canvas and drawing app

Started by mystd Aug 12, 2015 at 12:14 PM 2 replies 4.4k views
JohnnyCode
JohnnyCode

You can catch mouse move event over entire document area and translate it into canvas instead. If I understand corectly that your problem is that last mousemove on canvas is not exactly on the egde, leaving your trace unfinished into very next out-of-canvas position. This would also allow you to strat brushing when mouse returns onto canvas from the very outer space, starting on canvas from the last resoluted point out of canvas into first mouse-move point on canvas.

mystd
mystd

Well I already tried that the problem is the canvas is the size of the document so the cursor practically leaves the browser.

JohnnyCode
JohnnyCode

Well I can then surely tell, that you then have only a very few choices there.

One quite solid one in my opinion would be you could guess the intended trace as a derivative of last three resolved explicit points, and just finsh trace to that gessed derived point onto very edge. It would take a really very fast move to change such a derivative tangentiality more rapidly.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.