作図ソフト dia の改良版
修訂 | 4c01794c872d73c4f2f3d05cb43c659206340ea4 (tree) |
---|---|
時間 | 2014-11-02 23:04:23 |
作者 | Hans Breuer <hans@breu...> |
Commiter | Hans Breuer |
[transform] don't change image size to simulate rotation
still missing the capability to actually rotate the pixels.
@@ -472,26 +472,18 @@ draw_image(DiaRenderer *self, | ||
472 | 472 | DiaImage *image) |
473 | 473 | { |
474 | 474 | Point p1 = *point; |
475 | - Point p2 = p1; | |
475 | + Point pc = p1; | |
476 | 476 | DiaTransformRenderer *renderer = DIA_TRANSFORM_RENDERER (self); |
477 | 477 | DiaMatrix *m = g_queue_peek_tail (renderer->matrices); |
478 | 478 | g_return_if_fail (renderer->worker != NULL); |
479 | 479 | |
480 | 480 | /* ToDo: some support on the library level? */ |
481 | - p2.x += width; | |
482 | - p2.y += height; | |
481 | + pc.x += width/2.0; | |
482 | + pc.y += height/2.0; | |
483 | 483 | if (m) { |
484 | - transform_point (&p1, m); | |
485 | - transform_point (&p2, m); | |
486 | - /* don't reduce to negative */ | |
487 | - if (p2.x > p1.x) | |
488 | - width = p2.x - p1.x; | |
489 | - else | |
490 | - width = p1.x - p2.x; | |
491 | - if (p2.y > p1.y) | |
492 | - height = p2.y - p1.y; | |
493 | - else | |
494 | - height = p1.y - p2.y; | |
484 | + transform_point (&pc, m); | |
485 | + p1.x = pc.x - width/2.0; | |
486 | + p1.y = pc.y - height/2.0; | |
495 | 487 | } |
496 | 488 | /* FIXME: for now only the position is transformed */ |
497 | 489 | DIA_RENDERER_GET_CLASS (renderer->worker)->draw_image (renderer->worker, &p1, width, height, image); |