From f8c9a80737599196872bd4bb7bd42e208cf6274e Mon Sep 17 00:00:00 2001 From: Raul Gutierrez Segales Date: Sun, 27 Feb 2011 23:54:26 +0000 Subject: Avoid computing the x and y twice --- (limited to 'pysamples/load_block.py') diff --git a/pysamples/load_block.py b/pysamples/load_block.py index 566ed47..4f46a73 100644 --- a/pysamples/load_block.py +++ b/pysamples/load_block.py @@ -35,11 +35,13 @@ def myblock(lc, blkname): from tautils import find_group def make_block(lc, name, x, y, defaults): - lc.tw._new_block(name, x + 20, y + 20, defaults) + x_pos = x + 20 + y_pos = y + 20 + lc.tw._new_block(name, x_pos, y_pos, defaults) # Find the block we just created and attach it to a stack. lc.tw.drag_group = None - spr = lc.tw.sprite_list.find_sprite((x + 20, y + 20)) + spr = lc.tw.sprite_list.find_sprite((x_pos, y_pos)) if spr is not None: blk = lc.tw.block_list.spr_to_block(spr) if blk is not None: -- cgit v0.9.1