Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools.py')
-rw-r--r--tools.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/tools.py b/tools.py
index 594154c..68301ed 100644
--- a/tools.py
+++ b/tools.py
@@ -103,10 +103,9 @@ class CircleTool(Tool):
self.pt1 = cast_tuple_to_int(pygame.mouse.get_pos())
elif event.type == MOUSEBUTTONUP:
if event.button == 1:
- if self.radius > 1: # Elements doesn't like tiny shapes :(
- self.game.world.add.ball(self.pt1, self.radius,
- dynamic=True, density=1.0,
- restitution=0.16, friction=0.5)
+ self.game.world.add.ball(self.pt1, self.radius,
+ dynamic=True, density=1.0,
+ restitution=0.16, friction=0.5)
self.pt1 = None
def draw(self):
@@ -115,13 +114,9 @@ class CircleTool(Tool):
delta = distance(self.pt1,
cast_tuple_to_int(pygame.mouse.get_pos()))
if delta > 0:
- self.radius = delta
- if self.radius > 3:
- thick = 3
- else:
- thick = 0
+ self.radius = max(delta, 5)
pygame.draw.circle(self.game.screen, (100, 180, 255),
- self.pt1, int(self.radius), thick)
+ self.pt1, int(self.radius), 3)
pygame.draw.line(self.game.screen, (100, 180, 255), self.pt1,
cast_tuple_to_int(pygame.mouse.get_pos()), 1)