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:
authorPhilipp Oeser <info@graphics-engineer.com>2019-04-16 14:36:44 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-04-16 15:03:08 +0300
commit8535f4d07326ee351d5b889109e1c3e881b4905c (patch)
treeec70e16df544166d9e8b2588db401a9b54d6bfe3 /source/blender/editors/sculpt_paint/paint_image.c
parente7e05ba5fa8de4cf6519e91dd46d73ba985a7fae (diff)
Fix T63619: Fill Tool is misaligned when 'Gradient' is enabled
Reviewers: brecht Maniphest Tasks: T63619 Differential Revision: https://developer.blender.org/D4692
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 0fdd3043d0c..91b37442301 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -418,6 +418,8 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda
GPUVertFormat *format = immVertexFormat();
uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
+ ARegion *ar = pop->vc.ar;
+
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
GPU_line_width(4.0);
@@ -425,7 +427,7 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda
immBegin(GPU_PRIM_LINES, 2);
immVertex2i(pos, x, y);
- immVertex2i(pos, pop->startmouse[0], pop->startmouse[1]);
+ immVertex2i(pos, pop->startmouse[0] + ar->winrct.xmin, pop->startmouse[1] + ar->winrct.ymin);
immEnd();
GPU_line_width(2.0);
@@ -433,7 +435,7 @@ static void gradient_draw_line(bContext *UNUSED(C), int x, int y, void *customda
immBegin(GPU_PRIM_LINES, 2);
immVertex2i(pos, x, y);
- immVertex2i(pos, pop->startmouse[0], pop->startmouse[1]);
+ immVertex2i(pos, pop->startmouse[0] + ar->winrct.xmin, pop->startmouse[1] + ar->winrct.ymin);
immEnd();
immUnbindProgram();