diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-07-25 19:41:35 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-07-25 20:13:48 +0300 |
commit | 703dff333ce6cbc25c990042858a0c40f9a212cb (patch) | |
tree | c81cf84d6552a4b5aa3f4384f56507ff221465fb /source | |
parent | 00a3533429133f3be782a4e7d19938a0898f0d29 (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')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 6 |
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; } |