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():
137
137
# Drawing the Buttons
138
138
for object in objects :
139
139
object .process ()
140
-
141
140
# Draw the Canvas at the center of the screen
142
141
x , y = screen .get_size ()
143
142
screen .blit (canvas , [x / 2 - canvasSize [0 ]/ 2 , y / 2 - canvasSize [1 ]/ 2 ])
144
-
145
143
# Drawing with the mouse
146
144
if pygame .mouse .get_pressed ()[0 ]:
147
145
mx , my = pygame .mouse .get_pos ()
148
-
149
146
# Calculate Position on the Canvas
150
147
dx = mx - x / 2 + canvasSize [0 ]/ 2
151
148
dy = my - y / 2 + canvasSize [1 ]/ 2
152
-
153
149
pygame .draw .circle (
154
150
canvas ,
155
151
drawColor ,
156
152
[dx , dy ],
157
153
brushSize ,
158
154
)
159
-
160
155
# Reference Dot
161
156
pygame .draw .circle (
162
157
screen ,
You can’t perform that action at this time.
0 commit comments