Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2014-02-04 12:41:57 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-02-04 16:52:07 (GMT)
commita08cee03d7cf1b5363d45367b64f4297bc443ee9 (patch)
treee8d820225af0cb842e27cade55774101f56429a2
parentd3db6639e5420eff1fd7911afb8c78f20944f283 (diff)
Show image border and all the corners in background editor
Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
-rw-r--r--reorderwindow.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/reorderwindow.py b/reorderwindow.py
index c8cfbc2..2a891de 100644
--- a/reorderwindow.py
+++ b/reorderwindow.py
@@ -236,8 +236,22 @@ class ImageElement:
ctx.stroke()
ctx.restore()
+ # draw the image border
+ ctx.save()
+ ctx.translate(self.margin_x, self.margin_y)
+ ctx.set_line_width(2)
+ ctx.set_source_rgb(1, 1, 1)
+ ctx.rectangle(self.x, self.y, self.width, self.height)
+ ctx.stroke_preserve()
+ ctx.set_source_rgb(0, 0, 0)
+ ctx.set_dash([2])
+ ctx.stroke()
+ ctx.restore()
+
# draw hadles
self._draw_handle(ctx, self.x, self.y)
+ self._draw_handle(ctx, self.x + self.width - HANDLE_SIZE, self.y)
+ self._draw_handle(ctx, self.x, self.y + self.height - HANDLE_SIZE)
self._draw_handle(ctx, self.x + self.width - HANDLE_SIZE,
self.y + self.height - HANDLE_SIZE)
@@ -269,15 +283,11 @@ class ImageElement:
if self.is_in_point(start_x, start_y, self.points["lower_left"]):
x_final_pos = self.x + x_movement
- if x_final_pos < 0:
- x_movement -= x_final_pos
self.x += x_movement
self.width -= x_movement
self.height += y_movement
elif self.is_in_point(start_x, start_y, self.points["upper_right"]):
y_final_pos = self.y + y_movement
- if y_final_pos < 0:
- y_movement -= y_final_pos
self.y += y_movement
self.height -= y_movement
self.width += x_movement