[gtk/wip/baedert/gl-rework] transform: Scale+translate bounds directyl
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/gl-rework] transform: Scale+translate bounds directyl
- Date: Fri, 3 Jan 2020 16:10:11 +0000 (UTC)
commit c43cdada3562a50d7fed419940b084bd8ad3f2e5
Author: Timm Bäder <mail baedert org>
Date: Thu Jan 2 10:28:08 2020 +0100
transform: Scale+translate bounds directyl
Make these two code paths look the same.
gsk/gsktransform.c | 16 ++++++++--------
1 file 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]