summaryrefslogtreecommitdiffstats
path: root/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'window.cpp')
-rw-r--r--window.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/window.cpp b/window.cpp
index 39c7ebc..f2a2eda 100644
--- a/window.cpp
+++ b/window.cpp
@@ -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);