The calculation of view.pending.box.x for snap right should be based on output_width (not output_height). The inverse applies to view.pending.box.y for snap down.