~ubuntu-branches/debian/experimental/inkscape/experimental

« back to all changes in this revision

Viewing changes to src/knot.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Viehmann
  • Date: 2008-09-09 23:29:02 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080909232902-c50iujhk1w79u8e7
Tags: 0.46-2.1
* Non-maintainer upload.
* Add upstream patch fixing a crash in the open dialog
  in the zh_CN.utf8 locale. Closes: #487623.
  Thanks to Luca Bruno for the patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
282
282
/**
283
283
 * Called to handle events on knots.
284
284
 */
285
 
static int sp_knot_handler(SPCanvasItem *item, GdkEvent *event, SPKnot *knot)
 
285
static int sp_knot_handler(SPCanvasItem */*item*/, GdkEvent *event, SPKnot *knot)
286
286
{
287
287
    g_assert(knot != NULL);
288
288
    g_assert(SP_IS_KNOT(knot));
289
289
 
290
 
    g_object_ref(knot);
291
 
    tolerance = prefs_get_int_attribute_limited("options.dragtolerance", "value", 0, 0, 100);
 
290
    /* Run client universal event handler, if present */
292
291
 
293
292
    gboolean consumed = FALSE;
294
293
 
295
 
    /* Run client universal event handler, if present */
296
 
 
297
294
    g_signal_emit(knot, knot_signals[EVENT], 0, event, &consumed);
298
295
 
299
296
    if (consumed) {
300
297
        return TRUE;
301
298
    }
302
299
 
 
300
    g_object_ref(knot);
 
301
    tolerance = prefs_get_int_attribute_limited("options.dragtolerance", "value", 0, 0, 100);
 
302
 
303
303
    switch (event->type) {
304
304
        case GDK_2BUTTON_PRESS:
305
305
            if (event->button.button == 1) {
311
311
            }
312
312
            break;
313
313
        case GDK_BUTTON_PRESS:
314
 
            if (event->button.button == 1) {
 
314
            if (event->button.button == 1 && !knot->desktop->event_context->space_panning) {
315
315
                NR::Point const p = knot->desktop->w2d(NR::Point(event->button.x, event->button.y));
316
316
                sp_knot_start_dragging(knot, p, (gint) event->button.x, (gint) event->button.y, event->button.time);
317
317
                consumed = TRUE;
318
318
            }
319
319
            break;
320
320
        case GDK_BUTTON_RELEASE:
321
 
            if (event->button.button == 1) {
 
321
            if (event->button.button == 1 && !knot->desktop->event_context->space_panning) {
322
322
                knot->pressure = 0;
323
323
                if (transform_escaped) {
324
324
                    transform_escaped = false;
347
347
            }
348
348
            break;
349
349
        case GDK_MOTION_NOTIFY:
350
 
            if (grabbed) {
 
350
            if (grabbed && !knot->desktop->event_context->space_panning) {
351
351
                consumed = TRUE;
352
352
 
353
353
                if ( within_tolerance
379
379
                NR::Point p = motion_dt - knot->grabbed_rel_pos;
380
380
                sp_knot_request_position (knot, &p, event->motion.state);
381
381
                knot->desktop->scroll_to_point (&motion_dt);
 
382
                knot->desktop->set_coordinate_status(knot->pos); // display the coordinate of knot, not cursor - they may be different!
 
383
                if (event->motion.state & GDK_BUTTON1_MASK)
 
384
                    gobble_motion_events(GDK_BUTTON1_MASK);
382
385
                moved = TRUE;
383
386
            }
384
387
            break;