aboutsummaryrefslogtreecommitdiff
path: root/dw/ooffloatsmgr.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2015-12-29 23:46:40 +0100
committerSebastian Geerken <devnull@localhost>2015-12-29 23:46:40 +0100
commitc7fe0a3b121c9c9c5fbc9959c695e1661a5d1c42 (patch)
tree1f89e52d4a043c3c3c2d2e30cff56eff4fcf3844 /dw/ooffloatsmgr.cc
parent1eddbbd3dc4f4c78709d4c0d61d1354d7ccdfb8d (diff)
SRDOP: Fix(!) calculation of borders.
Diffstat (limited to 'dw/ooffloatsmgr.cc')
-rw-r--r--dw/ooffloatsmgr.cc27
1 files changed, 20 insertions, 7 deletions
diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc
index 2b6fc537..c5979104 100644
--- a/dw/ooffloatsmgr.cc
+++ b/dw/ooffloatsmgr.cc
@@ -1041,13 +1041,26 @@ int OOFFloatsMgr::getBorder (Side side, int y, int h, OOFAwareWidget *lastGB,
i, vloat->getWidget(), covers ? "<b>yes</b>" : "no");
if (covers) {
- int borderIn = side == LEFT ?
- vloat->generator->getStyle()->boxOffsetX() :
- vloat->generator->getStyle()->boxRestWidth();
- int thisBorder = vloat->size.width + borderIn;
- DBG_OBJ_MSGF ("border", 1, "thisBorder = %d + %d = %d",
- vloat->size.width, borderIn, thisBorder);
-
+ int x = calcFloatX (vloat), w, thisBorder;
+ switch (side) {
+ case LEFT:
+ thisBorder = x + vloat->size.width;
+ DBG_OBJ_MSGF ("border", 1, "thisBorder = %d + %d = %d (left)",
+ x, vloat->size.width, thisBorder);
+ break;
+
+ case RIGHT:
+ w = container->getGeneratorWidth () - x;
+ thisBorder = w - x;
+ DBG_OBJ_MSGF ("border", 1, "thisBorder = %d - %d = %d",
+ w, x, thisBorder);
+
+ default:
+ assertNotReached ();
+ thisBorder = 0;
+ break;
+ }
+
border = max (border, thisBorder);
}
}