If there is a position to which the boxes in boxes can be moved while maintaining the relative positions of the boxes in boxes to each other such that none of the boxes in boxes would overlap any of the boxes in output, and all the boxes in boxes would be within the video’s rendering area, then move the boxes in boxes to the closest such position to their current position,
The spec does not propose an algorithm for doing this, and I suspect that it is equivalent to implementing a constraint solver for systems of linear inequalities. (I'm not against this; if a constraint solver is the way create the best layout, so it is.)
It's not difficult to display a new cue and find a non-overlapping place for it (or, whether there is no such place). But figuring out how to minimally move around existing cues to make room for a new one is nontrivial.
The spec does not propose an algorithm for doing this, and I suspect that it is equivalent to implementing a constraint solver for systems of linear inequalities. (I'm not against this; if a constraint solver is the way create the best layout, so it is.)
It's not difficult to display a new cue and find a non-overlapping place for it (or, whether there is no such place). But figuring out how to minimally move around existing cues to make room for a new one is nontrivial.