mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 05:30:37 +00:00
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:
parent
00c843ffc6
commit
06dc196682
3 changed files with 30 additions and 11 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue