aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/styleengine.cc6
-rw-r--r--src/styleengine.hh1
2 files changed, 2 insertions, 5 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 024ef56d..f92cccf8 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -71,6 +71,7 @@ StyleEngine::StyleEngine (dw::core::Layout *layout,
this->pageUrl = pageUrl ? a_Url_dup(pageUrl) : NULL;
this->baseUrl = baseUrl ? a_Url_dup(baseUrl) : NULL;
importDepth = 0;
+ dpmm = layout->dpiX () / 25.4; /* assume dpiX == dpiY */
stackPush ();
Node *n = stack->getLastRef ();
@@ -760,11 +761,6 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props,
* \brief Resolve relative lengths to absolute values.
*/
bool StyleEngine::computeValue (int *dest, CssLength value, Font *font) {
- static float dpmm;
-
- if (dpmm == 0.0)
- dpmm = layout->dpiX () / 25.4; /* assume dpiX == dpiY */
-
switch (CSS_LENGTH_TYPE (value)) {
case CSS_LENGTH_TYPE_PX:
*dest = (int) CSS_LENGTH_VALUE (value);
diff --git a/src/styleengine.hh b/src/styleengine.hh
index 41f892d7..772e7f63 100644
--- a/src/styleengine.hh
+++ b/src/styleengine.hh
@@ -35,6 +35,7 @@ class StyleEngine {
CssContext *cssContext;
Doctree *doctree;
int importDepth;
+ float dpmm;
DilloUrl *pageUrl, *baseUrl;
void stackPush ();