diff options
author | Timm Bäder <mail@baedert.org> | 2020-01-02 10:28:08 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-01-07 17:27:18 +0100 |
commit | 7a27122dab06919486a1b10b4028e6add30b7c31 (patch) | |
tree | fe466b78d5d4544642e56b822ac5a58c3320ae00 /gsk/gsktransform.c | |
parent | 73ce43745967c865b2fba22ef267d61b38e923d6 (diff) | |
download | gtk+-7a27122dab06919486a1b10b4028e6add30b7c31.tar.gz |
transform: Scale+translate bounds directyl
Make these two code paths look the same.
Diffstat (limited to 'gsk/gsktransform.c')
-rw-r--r-- | gsk/gsktransform.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gsk/gsktransform.c b/gsk/gsktransform.c index 60f1f4a22f..9db4e4b4e2 100644 --- a/gsk/gsktransform.c +++ b/gsk/gsktransform.c @@ -1730,7 +1730,10 @@ gsk_transform_transform_bounds (GskTransform *self, float dx, dy; gsk_transform_to_translate (self, &dx, &dy); - graphene_rect_offset_r (rect, dx, dy, out_rect); + out_rect->origin.x = rect->origin.x + dx; + out_rect->origin.y = rect->origin.y + dy; + out_rect->size.width = rect->size.width; + out_rect->size.height = rect->size.height; } break; @@ -1740,13 +1743,10 @@ gsk_transform_transform_bounds (GskTransform *self, gsk_transform_to_affine (self, &scale_x, &scale_y, &dx, &dy); - *out_rect = *rect; - out_rect->origin.x *= scale_x; - out_rect->origin.y *= scale_y; - out_rect->size.width *= scale_x; - out_rect->size.height *= scale_y; - out_rect->origin.x += dx; - out_rect->origin.y += dy; + out_rect->origin.x = (rect->origin.x * scale_x) + dx; + out_rect->origin.y = (rect->origin.y * scale_y) + dy; + out_rect->size.width = rect->size.width * scale_x; + out_rect->size.height = rect->size.height * scale_y; } break; |