You are browsing as a guest. Sign up (or log in) to start making projects!

2h 12m 57s logged

Devlog #1 - Making it Click, Draw lines & Dots

Today I created a window on the screen that scales nicely to the user’s monitor and created a responsive digital canvas on which you can draw Lines and dots till now

The Problem and solution

I faced a problem that didn’t let me draw dots the problem was:-

clicking on the canvas without dragging the mouse left absolutely nothing on the screen.
The path-drawing logic expected continuous cursor updates to generate lines. 
Tapping the screen to place a single dot was functionally invisible.

So I introduced a self.has_moved variable which is set to False by default and when the user presses the left button and moves the mouse it is set to True
then we run a Check in the release event that if has_moved = False then it draws a dot otherwise it draws a line using self.last_point and self.current_point

0
3

Comments 0

No comments yet. Be the first!