diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2014-07-02 21:47:41 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2014-07-02 21:47:41 +0200 |
commit | b56a58caf9ef4d5087a9741bfa6a6cfb1977b631 (patch) | |
tree | 630515d430e06318a40bde72ba90d87dc17764b7 | |
parent | d4b1ef469fa0362035e55365923916a40998dc84 (diff) |
make dpmm a proper member of StyleEngine
-rw-r--r-- | src/styleengine.cc | 6 | ||||
-rw-r--r-- | src/styleengine.hh | 1 |
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 (); |