Corrected rendering of rectangle position and size