aboutsummaryrefslogtreecommitdiff
path: root/src/styleengine.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-09-26 10:22:34 +0200
committerSebastian Geerken <devnull@localhost>2013-09-26 10:22:34 +0200
commitc789b39fea45e2d950b8feb4fd03bd380de1f0e5 (patch)
treec0595bffa8601fc753e2e07419ce17c61d4693db /src/styleengine.cc
parent9bdbab27811d631db9c321380dea0842ec0af392 (diff)
CSS attribute 'background-position'.
Diffstat (limited to 'src/styleengine.cc')
-rw-r--r--src/styleengine.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc
index 6b35e33c..4c1a315c 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -629,6 +629,25 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props,
else if (attrs->wordSpacing < -1000)
attrs->wordSpacing = -1000;
break;
+ case CSS_PROPERTY_X_BACKGROUND_POSITION_X:
+ if (p->type == CSS_TYPE_ENUM)
+ // Enums are sorted: 0 = left = 0%; 1 = center = 50%;
+ // 2 = right = 100%.
+ attrs->backgroundPositionX =
+ createPerLength (0.5 * (double)p->value.intVal);
+ else
+ computeLength (&attrs->backgroundPositionX, p->value.intVal,
+ attrs->font);
+ break;
+ case CSS_PROPERTY_X_BACKGROUND_POSITION_Y:
+ if (p->type == CSS_TYPE_ENUM)
+ // See comment above.
+ attrs->backgroundPositionY =
+ createPerLength (0.5 * (double)p->value.intVal);
+ else
+ computeLength (&attrs->backgroundPositionY, p->value.intVal,
+ attrs->font);
+ break;
case PROPERTY_X_LINK:
attrs->x_link = p->value.intVal;
break;