[graph-gtk] Actually fixed selection when panning
- From: Isaac Wagner <isaacbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [graph-gtk] Actually fixed selection when panning
- Date: Tue, 31 Jul 2012 12:55:30 +0000 (UTC)
commit c70b4012ab6f96933bcf8d2eeda62ca9b2298640
Author: Isaac Wagner <isaacbw src gnome org>
Date: Tue Jul 31 08:55:14 2012 -0400
Actually fixed selection when panning
graph-gtk/graph-gtk-node.c | 4 ++--
graph-gtk/graph-gtk-view.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/graph-gtk/graph-gtk-node.c b/graph-gtk/graph-gtk-node.c
index 7584998..7efc08f 100644
--- a/graph-gtk/graph-gtk-node.c
+++ b/graph-gtk/graph-gtk-node.c
@@ -505,8 +505,8 @@ graph_gtk_node_add_pad(GraphGtkNode* self, const gchar* pad_name, gboolean outpu
gboolean
graph_gtk_node_is_within(GraphGtkNode* self, int x, int y)
{
- if(x > self->x+self->offset_x && x < self->x+self->offset_x+self->width &&
- y > self->y+self->offset_y && y < self->y+self->offset_y+self->height)
+ if(x > self->x && x < self->x+self->width &&
+ y > self->y && y < self->y+self->height)
{
return TRUE;
}
diff --git a/graph-gtk/graph-gtk-view.c b/graph-gtk/graph-gtk-view.c
index 91130ff..c5d5c5f 100644
--- a/graph-gtk/graph-gtk-view.c
+++ b/graph-gtk/graph-gtk-view.c
@@ -231,7 +231,7 @@ graph_gtk_view_draw(GtkWidget *widget, cairo_t* cr)
graph_gtk_pad_get_position(view->pad_connecting_from, &x, &y);
cairo_move_to(cr, x, y);
- cairo_line_to(cr, view->mouse_x, view->mouse_y);
+ cairo_line_to(cr, view->mouse_x+view->pan_x, view->mouse_y+view->pan_y);
cairo_set_source_rgb(cr, 0.0, 1, 0.0);
cairo_set_line_width(cr, 0.5);
@@ -269,14 +269,14 @@ graph_gtk_view_button_pressed(GtkWidget* widget, GdkEventButton* event)
GraphGtkNode *node = (GraphGtkNode*)nodes->data;
GraphGtkPad *pad;
- if(pad = graph_gtk_node_is_on_pad(node, event->x, event->y))
+ if(pad = graph_gtk_node_is_on_pad(node, event->x+self->pan_x, event->y+self->pan_y))
{
self->is_mouse_connecting = TRUE;
self->pad_connecting_from = pad;
if(!pad->is_output)
graph_gtk_pad_disconnect(pad);
}
- else if(graph_gtk_node_is_within(node, event->x, event->y))
+ else if(graph_gtk_node_is_within(node, event->x+self->pan_x, event->y+self->pan_y))
{
node->is_selected = TRUE;
deselect = g_list_remove(deselect, node);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]