Made the layout engine independent from tile spacing.