[gtk+] testinput: Fix cursor rendering



commit 2697ac5770d3fc81e857b0f8bed9545d8407398d
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Apr 3 10:51:36 2012 +0200

    testinput: Fix cursor rendering
    
    Make sure custom cursors are rendered at integer coordinates,
    otherwise there will be leftover alpha borders when we remove the
    cursor.

 tests/testinput.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/tests/testinput.c b/tests/testinput.c
index 957e6ae..2a2e4cc 100644
--- a/tests/testinput.c
+++ b/tests/testinput.c
@@ -25,6 +25,7 @@
 #include "config.h"
 #include <stdio.h>
 #include "gtk/gtk.h"
+#include <math.h>
 
 /* Backing surface for drawing area */
 
@@ -46,6 +47,9 @@ update_cursor (GtkWidget *widget,  gdouble x, gdouble y)
   static gint cursor_present = 0;
   gint state = !gdk_device_get_has_cursor (current_device) && cursor_proximity;
 
+  x = floor (x);
+  y = floor (y);
+
   if (surface != NULL)
     {
       cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]