Fixes height miscalculation in ellipsis function

The `ellipsis` funciton was removing an element
when it could be truncated instead. The situation had place when:
1) the parent + `after` element were higher than threshold,
2) appending the `after` element to the parent made it shorter than the threshold.