View Single Post
Posts: 2 | Thanked: 3 times | Joined on Dec 2008
#111
I have what I believe to be a fix to the "ghost lines" problem, but I can't seem to get the project to compile (the compiler complaining about python this and that... I have no idea how to fix that. I'm using the Maemo Dev VMWare image which is supposedly configured correctly but seems that isn't so). Anyway, if anyone else is able to compile the project and can test my changes, please let me know. I changed the function 'gtk_my_draw_widget_button_updown' in gtkmydrawwidget.c as follows, in order to enforce zero-pressure events when the pen is pressed to or lifted from the tablet:

Code:
static gint
gtk_my_draw_widget_button_updown (GtkWidget *widget, GdkEventButton *event)
{
  GtkMyDrawWidget * mdw;
  g_return_val_if_fail (widget != NULL, FALSE);
  g_return_val_if_fail (GTK_IS_MY_DRAW_WIDGET (widget), FALSE);
  mdw = GTK_MY_DRAW_WIDGET (widget);

  double pressure;
  if (!gdk_event_get_axis ((GdkEvent *)event, GDK_AXIS_PRESSURE, &pressure)) {
    pressure = (event->state & GDK_BUTTON1_MASK) ? 0.5 : 0;
  }

  if (event->state & GDK_BUTTON1_MASK)
    gtk_my_draw_widget_process_motion_or_button (widget, event->time, event->x, event->y, 0);

  gtk_my_draw_widget_process_motion_or_button (widget, event->time, event->x, event->y, pressure);

  if ((event->state & GDK_BUTTON1_MASK) == 0)
    gtk_my_draw_widget_process_motion_or_button (widget, event->time, event->x, event->y, 0);

  return TRUE;
}
 

The Following 2 Users Say Thank You to Johnathan For This Useful Post: