Ben NanoNote 3D scans
Sign in or create your account | Project List | Help
Ben NanoNote 3D scans Commit Details
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 | ||
---|---|---|
312 | 312 | static void do_shift(struct matrix *m, int dx, int dy) |
313 | 313 | { |
314 | 314 | m->b[0] += dx; |
315 | m->b[1] -= dy; | |
315 | m->b[1] += dy; | |
316 | 316 | } |
317 | 317 | |
318 | 318 | |
319 | 319 | static void shift(struct matrix *m, int dx, int dy, int dir) |
320 | 320 | { |
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 | ||
321 | 330 | if (dx > 0 && dy < dx && dy > -dx) |
322 | 331 | do_shift(m, dir, 0); |
323 | 332 | if (dx < 0 && dy < -dx && dy > dx) |
... | ... | |
325 | 334 | if (dy > 0 && dx < dy && dx > -dy) |
326 | 335 | do_shift(m, 0, dir); |
327 | 336 | if (dy < 0 && dx < -dy && dx > dy) |
328 | do_shift(m, 0, -dir); | |
337 | do_shift(m, 0, dir); /* exception ! */ | |
329 | 338 | } |
330 | 339 | |
331 | 340 | |
... | ... | |
363 | 372 | if (center) |
364 | 373 | shift(&s->a->m, dx, dy, 1); |
365 | 374 | else |
366 | rotate(&s->a->m, -r); | |
375 | rotate(&s->a->m, dx > 0 ? r : -r); | |
367 | 376 | draw_image(darea, s, osd); |
368 | 377 | break; |
369 | 378 | case GDK_SCROLL_DOWN: |
370 | 379 | if (center) |
371 | 380 | shift(&s->a->m, dx, dy, -1); |
372 | 381 | else |
373 | rotate(&s->a->m, r); | |
382 | rotate(&s->a->m, dx > 0 ? -r : r); | |
374 | 383 | draw_image(darea, s, osd); |
375 | 384 | break; |
376 | 385 | default: |
Branches:
master