Add autoscale support for element with scaletofit class

This is meant to auto scale the width to 100%, height to auto with
unchanged ratio. Currently only not working if resize/ or change
orientation