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.
This commit is contained in:
Alexander Larsson 2012-04-03 10:51:36 +02:00
parent 440e9cdfd3
commit 2697ac5770

View File

@ -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));