BoxPrimitive : wrong res calculations. Fixes #2941