corrected width/height calculation in onMeasure