summaryrefslogtreecommitdiff
path: root/dw/outofflowmgr.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-08-09 11:44:22 +0200
committerSebastian Geerken <devnull@localhost>2014-08-09 11:44:22 +0200
commitc042eb7a412bc44c66c9e316a1f85cff3fc01727 (patch)
tree2e5fb9e08f65a6f66bdc14e61b4c4a7c7a47b071 /dw/outofflowmgr.cc
parent8ed1dac050a856b58c41553727a3ffd36d64c80c (diff)
Empty lines are how (in most cases) higher than one pixel.
Diffstat (limited to 'dw/outofflowmgr.cc')
-rw-r--r--dw/outofflowmgr.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc
index 62386b15..2e6171ad 100644
--- a/dw/outofflowmgr.cc
+++ b/dw/outofflowmgr.cc
@@ -2026,6 +2026,40 @@ bool OutOfFlowMgr::hasFloat (Textblock *textblock, Side side, int y, int h,
return first != -1;
}
+int OutOfFlowMgr::getLeftFloatHeight (Textblock *textblock, int y, int h,
+ Textblock *lastGB, int lastExtIndex)
+{
+ return getFloatHeight (textblock, LEFT, y, h, lastGB, lastExtIndex);
+}
+
+int OutOfFlowMgr::getRightFloatHeight (Textblock *textblock, int y, int h,
+ Textblock *lastGB, int lastExtIndex)
+{
+ return getFloatHeight (textblock, RIGHT, y, h, lastGB, lastExtIndex);
+}
+
+// Calculate height from the position *y*.
+int OutOfFlowMgr::getFloatHeight (Textblock *textblock, Side side, int y, int h,
+ Textblock *lastGB, int lastExtIndex)
+{
+ DBG_OBJ_ENTER ("border", 0, "getFloatHeight", "%p, %s, %d, %d, %p, %d",
+ textblock, side == LEFT ? "LEFT" : "RIGHT", y, h,
+ lastGB, lastExtIndex);
+
+ SortedFloatsVector *list = getFloatsListForTextblock (textblock, side);
+ int first = list->findFirst (textblock, y, h, lastGB, lastExtIndex);
+ assert (first != -1); /* This method must not be called when there is no
+ float on the respective side. */
+
+ Float *vloat = list->get(first);
+ ensureFloatSize (vloat);
+ int height = vloat->size.ascent + vloat->size.descent + vloat->yReal - y;
+
+ DBG_OBJ_MSGF ("border", 1, "=> %d", height);
+ DBG_OBJ_LEAVE ();
+ return height;
+}
+
/**
* Returns position relative to the textblock "tb".
*/