From eb3e32b653fa3a6e4f9be4afb4a492eec593ef59 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 22 May 2023 10:45:15 +0200 Subject: [PATCH] Fix #108136: Regression : Texture paint is broken Mistake in the 406cfd214a which was calculating the offset wrongly. Pull Request: https://projects.blender.org/blender/blender/pulls/108138 --- source/blender/editors/sculpt_paint/paint_image_proj.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.cc b/source/blender/editors/sculpt_paint/paint_image_proj.cc index c3053805f02..b9b6f34dcb1 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.cc +++ b/source/blender/editors/sculpt_paint/paint_image_proj.cc @@ -1934,7 +1934,7 @@ static ProjPixel *project_paint_uvpixel_init(const ProjPaintState *ps, zero_v4(projPixel->newColor.f); } else { - projPixel->pixel.ch_pt = ibuf->byte_buffer.data + (x_px + y_px * ibuf->x); + projPixel->pixel.ch_pt = ibuf->byte_buffer.data + (x_px + y_px * ibuf->x) * 4; projPixel->origColor.uint_pt = (uint *)projima->undoRect[tile_index] + tile_offset; projPixel->newColor.uint_ = 0; }