summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRr422018-06-21 14:41:50 +0530
committerRr422018-06-21 14:41:50 +0530
commit09f4804515496cc301acf4d3cfab958223e02584 (patch)
tree049e61d12efb2480e232cd6157d557c2bd720527
parent62b404d735ba540b7b4c532705cfcc99d9d61d67 (diff)
downloadLDMicroGtk-09f4804515496cc301acf4d3cfab958223e02584.tar.gz
LDMicroGtk-09f4804515496cc301acf4d3cfab958223e02584.tar.bz2
LDMicroGtk-09f4804515496cc301acf4d3cfab958223e02584.zip
Bug fix, where clicks after scrolling where not registered properly.
-rw-r--r--ldmicro/ldmicro.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/ldmicro/ldmicro.cpp b/ldmicro/ldmicro.cpp
index 4c3bc30..17e9711 100644
--- a/ldmicro/ldmicro.cpp
+++ b/ldmicro/ldmicro.cpp
@@ -977,13 +977,22 @@ gboolean LD_GTK_mouse_click_hook(GtkWidget *widget, GdkEvent *event, gpointer us
* WM_LBUTTONDBLCLK, WM_LBUTTONDOWN
*/
// g_print("mo cl call\n");
+
+ GtkAdjustment *adjustment = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(ScrollWindow));
+ // g_print("---\nadj = %f\n", gtk_adjustment_get_value(adjustment));
+ // g_print("upper = %f\n", gtk_adjustment_get_upper(adjustment) - gtk_widget_get_allocated_height (ScrollWindow));
+ // g_print("lower = %f\n", gtk_adjustment_get_lower(adjustment));
+ // g_print("inc = %f\n", gtk_adjustment_get_step_increment(adjustment));
+ // g_print("w width = %i\n", gtk_widget_get_allocated_width (DrawWindow));
+ // g_print("w height = %i\n---\n", gtk_widget_get_allocated_height (ScrollWindow));
+
switch(event->button.type)
{
case GDK_BUTTON_PRESS:
if (event->button.button == 1) /// left click
{
int x = event->button.x;
- int y = event->button.y - 30;
+ int y = event->button.y - 30 + gtk_adjustment_get_value(adjustment);
// if((y > (IoListTop - 9)) && (y < (IoListTop + 3))) {
// // POINT pt;
@@ -1004,7 +1013,7 @@ gboolean LD_GTK_mouse_click_hook(GtkWidget *widget, GdkEvent *event, gpointer us
if (event->button.button == 1) /// left click
{
int x = event->button.x;
- int y = event->button.y - 30;
+ int y = event->button.y - 30 + gtk_adjustment_get_value(adjustment);
if(InSimulationMode) {
EditElementMouseDoubleclick(x, y);