I have a hard time finding a tutorial or an explanation on how I can draw in the DrawingCanvas object if I moved it, say, in the middle of the screen. Or basically anywhere other than x and y 0.
Expected behaviour: I can just draw in the DrawingCanvas and the pixels will appear exactly where the mouse was.
What actually happens: If the DrawingCanvas is 100x100 big I need to draw in the area inside x<100 and y<100 even though the DrawingCanvas is at 800, 600 or somewhere else. The lines will appear inside the DrawingCanvas though.
How do I convert mouse coordinates to relative DrawingCanvas coordinates?
Thanks in advance!