[gtk/wip/otte/transform: 39/41] fpsoverlay: Use new snapshot transforms
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/transform: 39/41] fpsoverlay: Use new snapshot transforms
- Date: Thu, 21 Feb 2019 04:41:36 +0000 (UTC)
commit 37f30fb27ca112af2b31cc02e7993c108278c1ec
Author: Benjamin Otte <otte redhat com>
Date: Thu Feb 21 05:34:12 2019 +0100
fpsoverlay: Use new snapshot transforms
gtk/inspector/fpsoverlay.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/inspector/fpsoverlay.c b/gtk/inspector/fpsoverlay.c
index 616781e7b1..5a58e8689c 100644
--- a/gtk/inspector/fpsoverlay.c
+++ b/gtk/inspector/fpsoverlay.c
@@ -215,8 +215,9 @@ gtk_fps_overlay_snapshot (GtkInspectorOverlay *overlay,
layout = gtk_widget_create_pango_layout (widget, fps_string);
pango_layout_get_pixel_size (layout, &width, &height);
+ gtk_snapshot_save (snapshot);
if (has_bounds)
- gtk_snapshot_offset (snapshot, bounds.origin.x + bounds.size.width - width, bounds.origin.y);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (bounds.origin.x + bounds.size.width - width,
bounds.origin.y));
if (overlay_opacity < 1.0)
gtk_snapshot_push_opacity (snapshot, overlay_opacity);
gtk_snapshot_append_color (snapshot,
@@ -227,8 +228,7 @@ gtk_fps_overlay_snapshot (GtkInspectorOverlay *overlay,
&(GdkRGBA) { 1, 1, 1, 1 });
if (overlay_opacity < 1.0)
gtk_snapshot_pop (snapshot);
- if (has_bounds)
- gtk_snapshot_offset (snapshot, - bounds.origin.x - bounds.size.width + width, - bounds.origin.y);
+ gtk_snapshot_restore (snapshot);
g_free (fps_string);
gtk_widget_add_tick_callback (widget, gtk_fps_overlay_force_redraw, NULL, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]