modify by tim.
fix canvas offset.