diff pyntnclick/tools/rect_drawer.py @ 690:4a933444c99b pyntnclick

The return of the rects to the rect drawer
author Neil Muller <neil@dip.sun.ac.za>
date Tue, 14 Feb 2012 12:24:33 +0200
parents 929b63589c96
children 60bf20849231
line wrap: on
line diff
--- a/pyntnclick/tools/rect_drawer.py	Mon Feb 13 18:24:08 2012 +0200
+++ b/pyntnclick/tools/rect_drawer.py	Tue Feb 14 12:24:33 2012 +0200
@@ -1,9 +1,6 @@
 # Quickly hacked together helper for working out
 # interactive regions in Suspended Sentence
 
-def frame_rect(*args):
-    pass
-
 Image = object
 request_old_filename = None
 
@@ -17,6 +14,7 @@
 import pyntnclick.constants
 from pyntnclick.widgets.text import LabelWidget, TextButton
 from pyntnclick.widgets.base import Container
+from pyntnclick.tools.utils import draw_rect_image
 
 
 class RectDrawerConstants(pyntnclick.constants.GameConstants):
@@ -103,7 +101,7 @@
                            -self.state.current_scene.OFFSET[1])
         self.find_existing_intersects()
         self.add_callback(MOUSEBUTTONDOWN, self.mouse_down)
-        self.add_callback(MOUSEBUTTONUP, self.mouse_down)
+        self.add_callback(MOUSEBUTTONUP, self.mouse_up)
         self.add_callback(MOUSEMOTION, self.mouse_move)
 
     def _get_scene(self):
@@ -277,10 +275,10 @@
                     self.end_pos[0] - self.start_pos[0],
                     self.end_pos[1] - self.start_pos[1])
             rect.normalize()
-            frame_rect(surface, self.rect_color, rect, self.draw_thick)
+            draw_rect_image(surface, self.rect_color, rect, self.draw_thick)
         if self.draw_rects:
             for (col, rect) in self.rects:
-                frame_rect(surface, col, rect, self.rect_thick)
+                draw_rect_image(surface, col, rect, self.rect_thick)
         if self.draw_images:
             for image in self.images:
                 if image.rect.colliderect(surface.get_rect()):