Move the clutter backend's resolution into the LengthNormalize

parent 02854cbf
...@@ -812,6 +812,7 @@ get_parent_font (StThemeNode *node) ...@@ -812,6 +812,7 @@ get_parent_font (StThemeNode *node)
typedef struct { typedef struct {
const PangoFontDescription *font_desc; const PangoFontDescription *font_desc;
double resolution;
} LengthNormalize; } LengthNormalize;
static LengthNormalize static LengthNormalize
...@@ -820,6 +821,7 @@ length_normalize (StThemeNode *node, const PangoFontDescription *desc) ...@@ -820,6 +821,7 @@ length_normalize (StThemeNode *node, const PangoFontDescription *desc)
LengthNormalize norm; LengthNormalize norm;
norm.font_desc = desc; norm.font_desc = desc;
norm.resolution = clutter_backend_get_resolution (clutter_get_default_backend ());
return norm; return norm;
} }
...@@ -950,8 +952,7 @@ get_length_from_term (StThemeNode *node, ...@@ -950,8 +952,7 @@ get_length_from_term (StThemeNode *node,
break; break;
case POINTS: case POINTS:
{ {
double resolution = clutter_backend_get_resolution (clutter_get_default_backend ()); *length = num->val * multiplier * (norm.resolution / 72.);
*length = num->val * multiplier * (resolution / 72.);
} }
break; break;
case FONT_RELATIVE: case FONT_RELATIVE:
...@@ -966,8 +967,7 @@ get_length_from_term (StThemeNode *node, ...@@ -966,8 +967,7 @@ get_length_from_term (StThemeNode *node,
} }
else else
{ {
double resolution = clutter_backend_get_resolution (clutter_get_default_backend ()); *length = num->val * multiplier * (norm.resolution / 72.) * font_size;
*length = num->val * multiplier * (resolution / 72.) * font_size;
} }
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment