diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-03-01 11:32:58 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-03-01 11:32:58 +0300 |
commit | 4a4701b43c53d1a4946e224821ba398548b22043 (patch) | |
tree | 5367f45f7f7cf8cfe14a2c00839ba590e960f9f1 /source/blender/blenkernel/intern/image_partial_update.cc | |
parent | 34f6a9943333f4b6c9727efb5db7bca1ffc7c531 (diff) |
Fix painting on none 256 aligned images.
Internally the update tiles are 256x256. Due to some miscalculations
tiles were not generated correctly if the dimension of the image wasn't
a multifold of 256.
Diffstat (limited to 'source/blender/blenkernel/intern/image_partial_update.cc')
-rw-r--r-- | source/blender/blenkernel/intern/image_partial_update.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/image_partial_update.cc b/source/blender/blenkernel/intern/image_partial_update.cc index 7e187c2014e..bec3c193af5 100644 --- a/source/blender/blenkernel/intern/image_partial_update.cc +++ b/source/blender/blenkernel/intern/image_partial_update.cc @@ -213,8 +213,8 @@ struct TileChangeset { tile_width = image_buffer->x; tile_height = image_buffer->y; - int chunk_x_len = tile_width / CHUNK_SIZE; - int chunk_y_len = tile_height / CHUNK_SIZE; + int chunk_x_len = (tile_width + CHUNK_SIZE - 1) / CHUNK_SIZE; + int chunk_y_len = (tile_height + CHUNK_SIZE - 1) / CHUNK_SIZE; init_chunks(chunk_x_len, chunk_y_len); return true; } |