[Xfce4-commits] <ristretto:master> Limit drawing of the selection-box to the inside of the image-frame.

Stephan Arts noreply at xfce.org
Sun Dec 18 09:18:01 CET 2011


Updating branch refs/heads/master
         to 89127b8c5899ba151bfced6f61e353042ad5e9b7 (commit)
       from c7e94713bc7d19a26bc0342f1b1dd5cab12a1b18 (commit)

commit 89127b8c5899ba151bfced6f61e353042ad5e9b7
Author: Stephan Arts <stephan at xfce.org>
Date:   Sun Dec 18 09:11:58 2011 +0100

    Limit drawing of the selection-box to the inside of the image-frame.

 src/image_viewer.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/image_viewer.c b/src/image_viewer.c
index a3eafea..702df06 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -1184,6 +1184,18 @@ paint_selection_box (
         box_height = (y_offset + image_height) - box_y - 1;
     }
 
+    /* Make sure the box dimensions are not negative,
+     * This results in rendering-artifacts.
+     */
+    if (box_width < 0.0)
+    {
+        box_width = 0.0;
+    }
+    if (box_height < 0.0)
+    {
+        box_height = 0.0;
+    }
+
     cairo_rectangle (
         ctx,
         box_x+0.5, box_y+0.5,


More information about the Xfce4-commits mailing list