Take opacity into account when updating a texture. Fix #384