summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmetacity/meta-draw-op.c2
-rw-r--r--libmetacity/meta-draw-spec-private.h2
-rw-r--r--libmetacity/meta-draw-spec.c11
3 files changed, 13 insertions, 2 deletions
diff --git a/libmetacity/meta-draw-op.c b/libmetacity/meta-draw-op.c
index 97bc1b43..10ffdb01 100644
--- a/libmetacity/meta-draw-op.c
+++ b/libmetacity/meta-draw-op.c
@@ -72,6 +72,8 @@ fill_env (MetaPositionExprEnv *env,
env->title_width = info->title_layout_width;
env->title_height = info->title_layout_height;
+
+ env->scale = info->scale;
}
static cairo_surface_t *
diff --git a/libmetacity/meta-draw-spec-private.h b/libmetacity/meta-draw-spec-private.h
index 0730a4eb..e842f22a 100644
--- a/libmetacity/meta-draw-spec-private.h
+++ b/libmetacity/meta-draw-spec-private.h
@@ -50,6 +50,8 @@ struct _MetaPositionExprEnv
gdouble mini_icon_height;
gdouble icon_width;
gdouble icon_height;
+
+ gint scale;
};
G_GNUC_INTERNAL
diff --git a/libmetacity/meta-draw-spec.c b/libmetacity/meta-draw-spec.c
index 6ecde1ba..0f0902ce 100644
--- a/libmetacity/meta-draw-spec.c
+++ b/libmetacity/meta-draw-spec.c
@@ -937,6 +937,8 @@ pos_eval_helper (PosToken *tokens,
if (paren_level == 0)
{
+ gdouble double_val;
+
switch (t->type)
{
case POS_TOKEN_INT:
@@ -963,15 +965,20 @@ pos_eval_helper (PosToken *tokens,
return FALSE;
case POS_TOKEN_VARIABLE:
- exprs[n_exprs].type = POS_EXPR_DOUBLE;
+ exprs[n_exprs].type = env->scale > 1 ? POS_EXPR_DOUBLE : POS_EXPR_INT;
/* FIXME we should just dump all this crap
* in a hash, maybe keep width/height out
* for optimization purposes
*/
- if (!pos_eval_get_variable (t, &exprs[n_exprs].d.double_val, env, err))
+ if (!pos_eval_get_variable (t, &double_val, env, err))
return FALSE;
+ if (env->scale > 1)
+ exprs[n_exprs].d.double_val = double_val;
+ else
+ exprs[n_exprs].d.int_val = double_val;
+
++n_exprs;
break;