canvas updated only on painted rectangle