[atomix/wip/gtk3-port] Fixed atom click events
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [atomix/wip/gtk3-port] Fixed atom click events
- Date: Mon, 12 Jan 2015 17:21:54 +0000 (UTC)
commit 3bdbdc144e12b9f5ff906a81bb46e4786c0e1e7d
Author: Robert Roth <robert roth off gmail com>
Date: Mon Jan 12 18:38:19 2015 +0200
Fixed atom click events
src/board_gtk.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/board_gtk.c b/src/board_gtk.c
index b5d3a36..77108e7 100644
--- a/src/board_gtk.c
+++ b/src/board_gtk.c
@@ -98,12 +98,19 @@ static void selector_arrows_hide (SelectorData *data);
static void get_row_col_by_item (GtkWidget *item, guint *row, guint *col)
{
gint x, y;
+ gint row_offset, col_offset;
g_return_if_fail (GTK_IS_WIDGET (item));
gtk_container_child_get (GTK_CONTAINER (board_canvas), item, "x", &x, "y", &y, NULL);
+ row_offset = BGR_FLOOR_ROWS / 2 - playfield_get_n_rows (board_env) / 2;
+ col_offset = BGR_FLOOR_COLS / 2 - playfield_get_n_cols (board_env) / 2;
+
convert_to_playfield (board_theme, x, y, row, col);
+
+ *row = *row - row_offset;
+ *col = *col - col_offset;
}
static gboolean board_handle_arrow_event (GtkWidget *item,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]