Date:2010-09-24 21:48:07 (13 years 6 months ago)
Author:Werner Almesberger
Commit:7c24783cab322ed2d33a6b1b2e85e2ec7e9dcd6c
Message:More corrections to handling of the "user" matrix. Made controls more intuitive.

- solidify/overlap.c (rotate): don't reverse y shift either
- solidify/overlap.c (scroll_event): reverse rotation (since we've fixed
the math of the coordinate transformation)
- solidify/overlap.c (scroll_event): reverse rotation if mouse is on the
left side
- solidify/overlap.c (shift): reversing the direction in the "down"
quadrant is systematic but quite confusing, so don't do it
Files: solidify/overlap.c (3 diffs)

Change Details

solidify/overlap.c
312312static void do_shift(struct matrix *m, int dx, int dy)
313313{
314314    m->b[0] += dx;
315    m->b[1] -= dy;
315    m->b[1] += dy;
316316}
317317
318318
319319static void shift(struct matrix *m, int dx, int dy, int dir)
320320{
321    /*
322     * Wheeling "up" in each quadrant shifts in the respective direction,
323     * wheeling "down" in the opposite direction.
324     *
325     * No rule without exception: we treat the "down" quadrant like the
326     * "up" quadrant, because it would be extremely counter-intuitive to
327     * wheel "up" to move "down".
328     */
329
321330    if (dx > 0 && dy < dx && dy > -dx)
322331        do_shift(m, dir, 0);
323332    if (dx < 0 && dy < -dx && dy > dx)
...... 
325334    if (dy > 0 && dx < dy && dx > -dy)
326335        do_shift(m, 0, dir);
327336    if (dy < 0 && dx < -dy && dx > dy)
328        do_shift(m, 0, -dir);
337        do_shift(m, 0, dir); /* exception ! */
329338}
330339
331340
...... 
363372        if (center)
364373            shift(&s->a->m, dx, dy, 1);
365374        else
366            rotate(&s->a->m, -r);
375            rotate(&s->a->m, dx > 0 ? r : -r);
367376        draw_image(darea, s, osd);
368377        break;
369378    case GDK_SCROLL_DOWN:
370379        if (center)
371380            shift(&s->a->m, dx, dy, -1);
372381        else
373            rotate(&s->a->m, r);
382            rotate(&s->a->m, dx > 0 ? -r : r);
374383        draw_image(darea, s, osd);
375384        break;
376385    default:

Archive Download the corresponding diff file

Branches:
master



interactive