better calculation for draw element size values