Prevent division by zero exception if a theme has no images for a

spinning or indeterminate progress indicator.
Ensure that a running animation is stopped when an indeterminate
indicator is changed into a determinate one.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29136 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2009-12-17 02:36:22 +00:00
parent 00c843ffc6
commit 06dc196682
3 changed files with 30 additions and 11 deletions

View file

@ -834,20 +834,26 @@ static NSImage *spinningImages[MaxCount];
{
NSRect imgBox = {{0,0}, {0,0}};
count = count % spinningMaxCount;
imgBox.size = [spinningImages[count] size];
[spinningImages[count] drawInRect: r
fromRect: imgBox
operation: NSCompositeSourceOver
fraction: 1.0];
if (spinningMaxCount != 0)
{
count = count % spinningMaxCount;
imgBox.size = [spinningImages[count] size];
[spinningImages[count] drawInRect: r
fromRect: imgBox
operation: NSCompositeSourceOver
fraction: 1.0];
}
}
else
{
if ([progress isIndeterminate])
{
count = count % indeterminateMaxCount;
[indeterminateColors[count] set];
NSRectFill(r);
if (indeterminateMaxCount != 0)
{
count = count % indeterminateMaxCount;
[indeterminateColors[count] set];
NSRectFill(r);
}
}
else
{