fixed pixel calculation for rect fill

bug fix provided by jks-liu