We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b31ad4d commit 66e5716Copy full SHA for 66e5716
gui-programming/drawing-tool-in-pygame/drawing_tool.py
@@ -137,26 +137,21 @@ def save():
137
# Drawing the Buttons
138
for object in objects:
139
object.process()
140
-
141
# Draw the Canvas at the center of the screen
142
x, y = screen.get_size()
143
screen.blit(canvas, [x/2 - canvasSize[0]/2, y/2 - canvasSize[1]/2])
144
145
# Drawing with the mouse
146
if pygame.mouse.get_pressed()[0]:
147
mx, my = pygame.mouse.get_pos()
148
149
# Calculate Position on the Canvas
150
dx = mx - x/2 + canvasSize[0]/2
151
dy = my - y/2 + canvasSize[1]/2
152
153
pygame.draw.circle(
154
canvas,
155
drawColor,
156
[dx, dy],
157
brushSize,
158
)
159
160
# Reference Dot
161
162
screen,
0 commit comments