[gtk/wip/baedert/gl-rework: 10/11] snapshot: Only normalize rectangle if we have to
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/gl-rework: 10/11] snapshot: Only normalize rectangle if we have to
- Date: Wed, 1 Jan 2020 18:06:46 +0000 (UTC)
commit 606306a97c00dc90554ec1e845723e4f74063b8a
Author: Timm Bäder <mail baedert org>
Date: Tue Dec 31 08:54:42 2019 +0100
snapshot: Only normalize rectangle if we have to
We can even replace the comment this way.
gtk/gtksnapshot.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index c87ba493f9..b1bee0fba9 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -587,8 +587,9 @@ gtk_graphene_rect_scale_affine (const graphene_rect_t *rect,
res->origin.y = scale_y * rect->origin.y + dy;
res->size.width = scale_x * rect->size.width;
res->size.height = scale_y * rect->size.height;
- /* necessary when scale_x or scale_y are < 0 */
- graphene_rect_normalize (res);
+
+ if (scale_x < 0 || scale_y < 0)
+ graphene_rect_normalize (res);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]