diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-02-08 16:44:02 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-02-08 16:45:36 +0300 |
commit | 52668c56b74f75c45a6b5176704dfd168fd3e6ac (patch) | |
tree | c818559d81985570dafa5ea746d25740af37b669 /source/blender/makesrna | |
parent | 4bc070a5193f927551a7c2aebb8c6306308bee4e (diff) |
GPencil: Layers with alpha = 0 should not be editable
* Added a new API function to test if a GPencil layer is visible or not
* Replaced all editability checks with this new "super check"
* Replaced all magic number thresholds for opacity visiblity with a single define
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index c1fc1a8a061..291456a591b 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -145,7 +145,7 @@ static int rna_GPencilLayer_is_stroke_visible_get(PointerRNA *ptr) * about this limit for showing/not showing */ bGPDlayer *gpl = (bGPDlayer *)ptr->data; - return (gpl->color[3] > 0.001f); + return (gpl->color[3] > GPENCIL_ALPHA_OPACITY_THRESH); } static int rna_GPencilLayer_is_fill_visible_get(PointerRNA *ptr) @@ -154,7 +154,7 @@ static int rna_GPencilLayer_is_fill_visible_get(PointerRNA *ptr) * about this limit for showing/not showing */ bGPDlayer *gpl = (bGPDlayer *)ptr->data; - return (gpl->fill[3] > 0.001f); + return (gpl->fill[3] > GPENCIL_ALPHA_OPACITY_THRESH); } static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr) |