fix for resize not taking padding into consideration