mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
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:
parent
440e9cdfd3
commit
2697ac5770
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user