Billy Williamton Posted February 1, 2018 Share Posted February 1, 2018 I've recently been messing around with drawing onto graphics objects via mouse events. I was expecting lineTo to draw pixel by pixel but it doesnt seem to do that. I think its drawing half pixels. It''s especially noticable when drawing angles. I tried setting roundPixels to true, but it doesnt seem to affect this. I can set it to draw rectangles onto the x and y locations of the mouse event but the event cant keep up with quick movements of the cursor. Any help is appreciated. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 1, 2018 Share Posted February 1, 2018 Telepath mode on. Its either about 1. strokes. Yeah. Half-pixels, like in canvas2d. (0.5, 0.5) is the center of a pixel, if line width is 1 then it will take full pixel. (0,0) is the corner, and +-0.5 are in different pixels Welcome to canvas world. Any platform, any engine, same s@#$. 2. your input is too close and one of algorithms inside https://github.com/pixijs/pixi.js/tree/dev/src/core/graphics thinks that two neighbour points are the same. 3. shader precision. Dont try coordinates like "1000000.5" , you'll lose precision and in iOS its pretty bad. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.