implement scale x and y for elements