converted a multiple if into a nested one.

* plug-ins/gimpressionist/repaint.c: converted a multiple if into
a nested one.
This commit is contained in:
Shlomi Fish 2004-07-29 12:55:46 +00:00
parent cb1d7109a7
commit d7b314d13f
2 changed files with 30 additions and 17 deletions

View File

@ -1,3 +1,8 @@
2004-07-29 Shlomi Fish <shlomif@iglu.org.il>
* plug-ins/gimpressionist/repaint.c: converted a multiple if into
a nested one.
2004-07-29 Sven Neumann <sven@gimp.org>
* app/core/core-enums.h: removed enums GimpImageType and

View File

@ -725,23 +725,31 @@ void repaint(ppm_t *p, ppm_t *a)
}
/* Handle Adaptive selections */
/* TODO : Nest the ifs here. */
if((runningvals.orienttype == ORIENTATION_ADAPTIVE) &&
(runningvals.sizetype == SIZE_TYPE_ADAPTIVE))
{
n = choose_best_brush(p, a, tx-maxbrushwidth/2, ty-maxbrushheight/2,
brushes, num_brushes, brushes_sum, 0, 1);
} else if(runningvals.orienttype == ORIENTATION_ADAPTIVE) {
int st = sn * runningvals.orientnum;
n = choose_best_brush(p, a, tx-maxbrushwidth/2, ty-maxbrushheight/2,
brushes, st+runningvals.orientnum, brushes_sum, st, 1);
} else if(runningvals.sizetype == SIZE_TYPE_ADAPTIVE) {
n = choose_best_brush(p, a, tx-maxbrushwidth/2, ty-maxbrushheight/2,
brushes, num_brushes, brushes_sum, on, runningvals.orientnum);
} else {
n = sn * runningvals.orientnum + on;
}
if (runningvals.orienttype == ORIENTATION_ADAPTIVE)
{
if (runningvals.sizetype == SIZE_TYPE_ADAPTIVE)
n = choose_best_brush (p, a, tx-maxbrushwidth/2,
ty-maxbrushheight/2, brushes,
num_brushes, brushes_sum, 0, 1);
else
{
int st = sn * runningvals.orientnum;
n = choose_best_brush (p, a, tx-maxbrushwidth/2,
ty-maxbrushheight/2, brushes,
st+runningvals.orientnum, brushes_sum,
st, 1);
}
}
else
{
if (runningvals.sizetype == SIZE_TYPE_ADAPTIVE)
n = choose_best_brush (p, a, tx-maxbrushwidth/2,
ty-maxbrushheight/2, brushes,
num_brushes, brushes_sum,
on, runningvals.orientnum);
else
n = sn * runningvals.orientnum + on;
}
/* Should never happen, but hey... */
if(n < 0) n = 0;
else if(n >= num_brushes) n = num_brushes - 1;