Changed to border-box layout, and updated the width and height attribute calculations as expected.