File tree Expand file tree Collapse file tree 1 file changed +0
-5
lines changed
gui-programming/drawing-tool-in-pygame Expand file tree Collapse file tree 1 file changed +0
-5
lines changed Original file line number Diff line number Diff line change @@ -137,26 +137,21 @@ def save():
137137 # Drawing the Buttons
138138 for object in objects :
139139 object .process ()
140-
141140 # Draw the Canvas at the center of the screen
142141 x , y = screen .get_size ()
143142 screen .blit (canvas , [x / 2 - canvasSize [0 ]/ 2 , y / 2 - canvasSize [1 ]/ 2 ])
144-
145143 # Drawing with the mouse
146144 if pygame .mouse .get_pressed ()[0 ]:
147145 mx , my = pygame .mouse .get_pos ()
148-
149146 # Calculate Position on the Canvas
150147 dx = mx - x / 2 + canvasSize [0 ]/ 2
151148 dy = my - y / 2 + canvasSize [1 ]/ 2
152-
153149 pygame .draw .circle (
154150 canvas ,
155151 drawColor ,
156152 [dx , dy ],
157153 brushSize ,
158154 )
159-
160155 # Reference Dot
161156 pygame .draw .circle (
162157 screen ,
You can’t perform that action at this time.
0 commit comments