Fix assertion when using Texture.load_sub_image to load entire image

This commit is contained in:
rdb 2017-03-22 22:42:21 +01:00
parent 64a7fbab87
commit d8066e19b1

View File

@ -3441,8 +3441,8 @@ do_load_sub_image(CData *cdata, const PNMImage &image, int x, int y, int z, int
nassertr(y >= 0 && y < tex_y_size, false); nassertr(y >= 0 && y < tex_y_size, false);
nassertr(z >= 0 && z < tex_z_size, false); nassertr(z >= 0 && z < tex_z_size, false);
nassertr(image.get_x_size() + x < tex_x_size, false); nassertr(image.get_x_size() + x <= tex_x_size, false);
nassertr(image.get_y_size() + y < tex_y_size, false); nassertr(image.get_y_size() + y <= tex_y_size, false);
// Flip y // Flip y
y = cdata->_y_size - (image.get_y_size() + y); y = cdata->_y_size - (image.get_y_size() + y);