mirror of
https://github.com/transmission/transmission
synced 2025-01-31 11:23:40 +00:00
only use integral numbers for the height of the pieces bar
This commit is contained in:
parent
ef5f2cb469
commit
88d6b568a4
1 changed files with 8 additions and 8 deletions
|
@ -559,13 +559,12 @@
|
|||
|
||||
- (void) drawBar: (NSRect) barRect
|
||||
{
|
||||
CGFloat piecesBarPercent = [(TorrentTableView *)[self controlView] piecesBarPercent];
|
||||
if (piecesBarPercent > 0.0f)
|
||||
const CGFloat piecesBarPercent = [(TorrentTableView *)[self controlView] piecesBarPercent];
|
||||
if (piecesBarPercent > 0.0)
|
||||
{
|
||||
NSRect regularBarRect = barRect, piecesBarRect = barRect;
|
||||
piecesBarRect.size.height *= PIECES_TOTAL_PERCENT * piecesBarPercent;
|
||||
regularBarRect.size.height -= piecesBarRect.size.height;
|
||||
piecesBarRect.origin.y += regularBarRect.size.height;
|
||||
NSRect piecesBarRect, regularBarRect;
|
||||
NSDivideRect(barRect, &piecesBarRect, ®ularBarRect, floorf(NSHeight(barRect) * PIECES_TOTAL_PERCENT * piecesBarPercent),
|
||||
NSMaxYEdge);
|
||||
|
||||
[self drawRegularBar: regularBarRect];
|
||||
[self drawPiecesBar: piecesBarRect];
|
||||
|
@ -578,7 +577,7 @@
|
|||
}
|
||||
|
||||
[fBarBorderColor set];
|
||||
[NSBezierPath strokeRect: NSInsetRect(barRect, 0.5f, 0.5f)];
|
||||
[NSBezierPath strokeRect: NSInsetRect(barRect, 0.5, 0.5)];
|
||||
}
|
||||
|
||||
- (void) drawRegularBar: (NSRect) barRect
|
||||
|
@ -631,7 +630,8 @@
|
|||
NSDivideRect(missingRect, &wantedRect, &missingRect, widthRemaining, NSMinXEdge);
|
||||
|
||||
//not-available section
|
||||
if ([torrent isActive] && ![torrent isChecking] && [fDefaults boolForKey: @"DisplayProgressBarAvailable"])
|
||||
if ([torrent isActive] && ![torrent isChecking] && [fDefaults boolForKey: @"DisplayProgressBarAvailable"]
|
||||
&& [torrent availableDesired] > 0.0)
|
||||
{
|
||||
NSRect unavailableRect;
|
||||
NSDivideRect(wantedRect, &wantedRect, &unavailableRect, floorf([torrent availableDesired] * NSWidth(wantedRect)),
|
||||
|
|
Loading…
Reference in a new issue