Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2022-07-25 19:41:35 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-07-25 20:13:48 +0300
commit703dff333ce6cbc25c990042858a0c40f9a212cb (patch)
treec81cf84d6552a4b5aa3f4384f56507ff221465fb /source/blender
parent00a3533429133f3be782a4e7d19938a0898f0d29 (diff)
Fix T99459: GPencil: Fill tool on the surface not in the correct place
There is a 1 pixel error in the size registered for the buffer dimensions. NOTE: This issue indicates that the texture scale is different from the region, so the mouse-based coordinates used are actually misaligned. This misalignment will be fixed in another commit. Regression probably introduced in rB1d49293b8044 + rB45f167237f0c8
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 5405867be56..df5ff163cf2 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -2247,16 +2247,16 @@ void view3d_depths_rect_create(ARegion *region, rcti *rect, ViewDepths *r_d)
static ViewDepths *view3d_depths_create(ARegion *region)
{
ViewDepths *d = MEM_callocN(sizeof(ViewDepths), "ViewDepths");
- d->w = region->winx;
- d->h = region->winy;
{
GPUViewport *viewport = WM_draw_region_get_viewport(region);
GPUTexture *depth_tx = GPU_viewport_depth_texture(viewport);
uint32_t *int_depths = GPU_texture_read(depth_tx, GPU_DATA_UINT_24_8, 0);
+ d->w = GPU_texture_width(depth_tx);
+ d->h = GPU_texture_height(depth_tx);
d->depths = (float *)int_depths;
/* Convert in-place. */
- int pixel_count = GPU_texture_width(depth_tx) * GPU_texture_height(depth_tx);
+ int pixel_count = d->w * d->h;
for (int i = 0; i < pixel_count; i++) {
d->depths[i] = (int_depths[i] >> 8u) / (float)0xFFFFFF;
}