fix a bug for dividing canvas