diff options
Diffstat (limited to 'window.cpp')
-rw-r--r-- | window.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -32,7 +32,7 @@ static gboolean scrollEvent(GtkWidget *widget, GdkEventScroll *event, gpointer u } static gboolean buttonEvent(GtkWidget *widget, GdkEventButton *event, gpointer user_data) { - VERTEX v = {event->x, event->y}; + Vertex v(event->x, event->y); switch(event->type) { case GDK_BUTTON_PRESS: @@ -65,14 +65,11 @@ static gboolean buttonEvent(GtkWidget *widget, GdkEventButton *event, gpointer u } gboolean crossingNotifyEvent(GtkWidget *widget, GdkEventCrossing *event, gpointer user_data) { - VERTEX v; + Vertex v(event->x, event->y); switch(event->type) { case GDK_ENTER_NOTIFY: - v.x = event->x; - v.y = event->y; - viewToImage(&v); setHoveredVertex(&v); @@ -87,11 +84,9 @@ gboolean crossingNotifyEvent(GtkWidget *widget, GdkEventCrossing *event, gpointe } gboolean motionNotifyEvent(GtkWidget *widget, GdkEventMotion *event, gpointer user_data) { - VERTEX v; + Vertex v(event->x, event->y); ROOM *last = getHoveredRoom(); - v.x = event->x; - v.y = event->y; viewToImage(&v); |