After launching the test program (main.cpp), press B. Notice that there is no 1-pixel gap below the blue rectangle even through I asked for a 1-pixel margin (bottom.png). Now press T. Notice that there is now a 1-pixel gap above the red rectangle (top.png).
The bug is probably due to this:
...which has been the cause of numerous bugs in my own code.