diff options
Diffstat (limited to 'source/blender/editors/space_image/image_undo.c')
-rw-r--r-- | source/blender/editors/space_image/image_undo.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/source/blender/editors/space_image/image_undo.c b/source/blender/editors/space_image/image_undo.c index 577c4e24b11..b6b32293cee 100644 --- a/source/blender/editors/space_image/image_undo.c +++ b/source/blender/editors/space_image/image_undo.c @@ -115,7 +115,7 @@ typedef struct PaintTile { ushort *mask; bool valid; bool use_float; - int x, y; + int x_tile, y_tile; } PaintTile; static void ptile_free(PaintTile *ptile) @@ -154,7 +154,7 @@ void *ED_image_paint_tile_find(ListBase *paint_tiles, bool validate) { for (PaintTile *ptile = paint_tiles->first; ptile; ptile = ptile->next) { - if (ptile->x == x_tile && ptile->y == y_tile) { + if (ptile->x_tile == x_tile && ptile->y_tile == y_tile) { if (ptile->image == image && ptile->ibuf == ibuf) { if (r_mask) { /* allocate mask if requested. */ @@ -206,8 +206,8 @@ void *ED_image_paint_tile_push(ListBase *paint_tiles, ptile->image = image; ptile->ibuf = ibuf; - ptile->x = x_tile; - ptile->y = y_tile; + ptile->x_tile = x_tile; + ptile->y_tile = y_tile; /* add mask explicitly here */ if (r_mask) { @@ -269,8 +269,14 @@ static void ptile_restore_runtime_list(ListBase *paint_tiles) SWAP(uint *, ptile->rect.uint, tmpibuf->rect); } - IMB_rectcpy( - ibuf, tmpibuf, ptile->x, ptile->y, 0, 0, ED_IMAGE_UNDO_TILE_SIZE, ED_IMAGE_UNDO_TILE_SIZE); + IMB_rectcpy(ibuf, + tmpibuf, + ptile->x_tile * ED_IMAGE_UNDO_TILE_SIZE, + ptile->y_tile * ED_IMAGE_UNDO_TILE_SIZE, + 0, + 0, + ED_IMAGE_UNDO_TILE_SIZE, + ED_IMAGE_UNDO_TILE_SIZE); if (has_float) { SWAP(float *, ptile->rect.fp, tmpibuf->rect_float); @@ -764,7 +770,7 @@ static bool image_undosys_step_encode(struct bContext *C, utile->users = 1; utile->rect.pt = ptile->rect.pt; ptile->rect.pt = NULL; - const uint tile_index = index_from_xy(ptile->x, ptile->y, ubuf_pre->tiles_dims); + const uint tile_index = index_from_xy(ptile->x_tile, ptile->y_tile, ubuf_pre->tiles_dims); BLI_assert(ubuf_pre->tiles[tile_index] == NULL); ubuf_pre->tiles[tile_index] = utile; |