diff options
author | Sebastian Geerken <devnull@localhost> | 2016-01-06 23:45:48 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2016-01-06 23:45:48 +0100 |
commit | 190b03da4be84d0cb21782dc019d6ffd756024a3 (patch) | |
tree | e06eb01e943b94c796236fd7f363158f585fc910 | |
parent | 85ed5cc02e6787450cbeb7cecdd5560c9616e6d0 (diff) |
Fix calculation of borders.
-rw-r--r-- | dw/ooffloatsmgr.cc | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc index 52f79954..a4750e5a 100644 --- a/dw/ooffloatsmgr.cc +++ b/dw/ooffloatsmgr.cc @@ -1066,26 +1066,33 @@ int OOFFloatsMgr::getBorder (Side side, int y, int h, OOFAwareWidget *lastGB, i, vloat->getWidget(), covers ? "<b>yes</b>" : "no"); if (covers) { - int x = calcFloatX (vloat), w, thisBorder; + int d; switch (side) { case LEFT: - thisBorder = x + vloat->size.width; - DBG_OBJ_MSGF ("border", 1, "thisBorder = %d + %d = %d (left)", - x, vloat->size.width, thisBorder); + d = vloat->generator->getGeneratorX (oofmIndex) + + vloat->generator->getStyle()->boxOffsetX (); break; case RIGHT: - w = container->getGeneratorWidth (); - thisBorder = w - x; - DBG_OBJ_MSGF ("border", 1, "thisBorder = %d - %d = %d", - w, x, thisBorder); + // There is no simple possibility to get the difference between + // container and generator at the right border (as it is at the + // left border, see above). We have to calculate the difference + // between the maximal widths. + d = container->getMaxGeneratorWidth () + - (vloat->generator->getGeneratorX (oofmIndex) + + vloat->generator->getMaxGeneratorWidth ()) + + vloat->generator->getStyle()->boxRestWidth (); break; default: assertNotReached (); - thisBorder = 0; + d = 0; break; } + + int thisBorder = vloat->size.width + d; + DBG_OBJ_MSGF ("border", 1, "thisBorder = %d + %d = %d", + vloat->size.width, d, thisBorder); border = max (border, thisBorder); } |