[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50601] trunk/blender/source/blender/ editors/interface/interface.c: Correction to rev50582: LABEL could have a1 = 1.0f and in this case a2 would be used as alpha multiplier for ic

Sergey Sharybin sergey.vfx at gmail.com
Sat Sep 15 07:06:43 CEST 2012


Was thinking about this too.

There are quite a lot of functions accepting button type and a1, a2
arguments, so couldn't find nice way to avoid that cryptic condition.

Could think about two ways:
- Enable that alpha behavior for internal routines only. This is a bit
silly and also not actuallt less cyptic -- why some cases would bypass
check and some not.
- Split condition into smaller pieces, something like this
http://www.pasteall.org/35253/diff  This is is the less confusing way, what
do you think?

On Sat, Sep 15, 2012 at 5:15 AM, Campbell Barton <ideasman42 at gmail.com>wrote:

> In this case we could have a wrapper function around LABEL use, this
> is quite cryptic use of a1 & a2.
>
> On Sat, Sep 15, 2012 at 2:41 AM, Sergey Sharybin <sergey.vfx at gmail.com>
> wrote:
> > Revision: 50601
> >
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50601
> > Author:   nazgul
> > Date:     2012-09-14 16:41:00 +0000 (Fri, 14 Sep 2012)
> > Log Message:
> > -----------
> > Correction to rev50582: LABEL could have a1 = 1.0f and in this case a2
> would be used as alpha multiplier for icon
> >
> > Revision Links:
> > --------------
> >
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50582
> >
> > Modified Paths:
> > --------------
> >     trunk/blender/source/blender/editors/interface/interface.c
> >
> > Modified: trunk/blender/source/blender/editors/interface/interface.c
> > ===================================================================
> > --- trunk/blender/source/blender/editors/interface/interface.c
>  2012-09-14 15:23:02 UTC (rev 50600)
> > +++ trunk/blender/source/blender/editors/interface/interface.c
>  2012-09-14 16:41:00 UTC (rev 50601)
> > @@ -2595,7 +2595,7 @@
> >
> >         /* we could do some more error checks here */
> >         if ((type & BUTTYPE) == LABEL) {
> > -               BLI_assert((poin != NULL || a1 != 0.0f || a2 != 0.0f ||
> min != 0.0f || max != 0.0f) == FALSE);
> > +               BLI_assert((poin != NULL || min != 0.0f || max != 0.0f
> || (a1 == 0.0f && a2 != 0.0f) || (a1 != 0.0f && a1 != 1.0f)) == FALSE);
> >         }
> >
> >         if (type & UI_BUT_POIN_TYPES) {  /* a pointer is required */
> >
> > _______________________________________________
> > Bf-blender-cvs mailing list
> > Bf-blender-cvs at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>
>
>
> --
> - Campbell
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>



-- 
With best regards, Sergey Sharybin


More information about the Bf-committers mailing list