Commit: 682685ba222f8b0bffa03a2c59621aee42d05d36
Author: Antonio Vazquez
Date:   Wed Jan 10 19:15:52 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB682685ba222f8b0bffa03a2c59621aee42d05d36

End operator if click out of panel

===================================================================

M       source/blender/editors/gpencil/gpencil_colorpick.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_colorpick.c 
b/source/blender/editors/gpencil/gpencil_colorpick.c
index 15a48461b87..569fcf8f41e 100644
--- a/source/blender/editors/gpencil/gpencil_colorpick.c
+++ b/source/blender/editors/gpencil/gpencil_colorpick.c
@@ -397,6 +397,13 @@ static int gpencil_colorpick_invoke(bContext *C, 
wmOperator *op, const wmEvent *
 static bool set_color(const wmEvent *event, tGPDpick *tgpk)
 {
        tGPDpickColor *tcol = tgpk->colors;
+       /* if click out of panel end */
+       if ((event->mval[0] <= tgpk->panel.xmin) || (event->mval[0] >= 
tgpk->panel.xmax) ||
+               (event->mval[1] <= tgpk->panel.ymin) || (event->mval[1] >= 
tgpk->panel.ymax))
+       {
+               return true;
+       }
+
        for (int i = 0; i < tgpk->totcolor; i++, tcol++) {
                if ((event->mval[0] >= tcol->rect.xmin) && (event->mval[0] <= 
tcol->rect.xmax) &&
                        (event->mval[1] >= tcol->rect.ymin) && (event->mval[1] 
<= tcol->rect.ymax))

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to