Simplified fabric.util.getBoundingRect code