mwg API
    Preparing search index...

    Function floatingTextStackLift

    • The y older must sit at to clear below, or older.y when it already does.

      The direction is the point, and it is why this returns a position rather than an offset to add: Java's FloatingText.push() anchors the newcomer on the target and lifts the lines already there (above.setPos(above.left(), below.top() - above.height() - 4)), the opposite of moving the newcomer out of the way. Pop-ups rise, so the older ones belong above the newer ones - an offset the caller adds is direction-ambiguous, a position the caller assigns is not.

      Both boxes are anchored at their centre, so a line's top is y - height / 2; a line is clear when its bottom plus the gap no longer reaches the other's top.

      Exported and pure on purpose: the stacking rule is arithmetic, and this way it is checked as arithmetic rather than through a rendered label (Label needs a DOM to measure text).

      Parameters

      Returns number