[metacity/gnome-3-20] libmetacity: add scale to MetaDrawInfo
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity/gnome-3-20] libmetacity: add scale to MetaDrawInfo
- Date: Sun, 5 Feb 2017 22:01:20 +0000 (UTC)
commit d3c2b0f67be512f45535246250b8f35987734619
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Nov 28 17:00:08 2016 +0200
libmetacity: add scale to MetaDrawInfo
libmetacity/meta-draw-op-private.h | 14 ++++++++------
libmetacity/meta-draw-op.c | 3 +--
libmetacity/meta-theme-metacity.c | 2 ++
3 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/libmetacity/meta-draw-op-private.h b/libmetacity/meta-draw-op-private.h
index 138ecec..5ddb81b 100644
--- a/libmetacity/meta-draw-op-private.h
+++ b/libmetacity/meta-draw-op-private.h
@@ -77,16 +77,18 @@ typedef enum
struct _MetaDrawInfo
{
+ gint scale;
+
GdkPixbuf *mini_icon;
GdkPixbuf *icon;
PangoLayout *title_layout;
- int title_layout_width;
- int title_layout_height;
+ gint title_layout_width;
+ gint title_layout_height;
- gint left_width;
- gint right_width;
- gint top_height;
- gint bottom_height;
+ gint left_width;
+ gint right_width;
+ gint top_height;
+ gint bottom_height;
gdouble width;
gdouble height;
diff --git a/libmetacity/meta-draw-op.c b/libmetacity/meta-draw-op.c
index 3d503fa..97bc1b4 100644
--- a/libmetacity/meta-draw-op.c
+++ b/libmetacity/meta-draw-op.c
@@ -22,7 +22,6 @@
#include <math.h>
#include "meta-draw-op-private.h"
-#include "meta-theme-impl-private.h"
#define GDK_COLOR_RGB(color) \
((guint32) (((int)((color).red * 255) << 16) | \
@@ -576,7 +575,7 @@ draw_op_draw_with_env (const MetaDrawOp *op,
gdouble rx, ry, rwidth, rheight;
cairo_surface_t *surface;
- scale = get_window_scaling_factor ();
+ scale = info->scale;
cairo_scale (cr, 1.0 / scale, 1.0 / scale);
if (op->data.image.pixbuf)
diff --git a/libmetacity/meta-theme-metacity.c b/libmetacity/meta-theme-metacity.c
index c16cd29..19ea9a1 100644
--- a/libmetacity/meta-theme-metacity.c
+++ b/libmetacity/meta-theme-metacity.c
@@ -5381,6 +5381,8 @@ meta_theme_metacity_draw_frame (MetaThemeImpl *impl,
pango_layout_get_pixel_extents (title_layout,
NULL, &extents);
+ draw_info.scale = scale;
+
draw_info.mini_icon = mini_icon;
draw_info.icon = icon;
draw_info.title_layout = title_layout;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]