Changeset 9492


Ignore:
Timestamp:
Nov 7, 2009, 11:20:41 PM (13 years ago)
Author:
livings124
Message:

when determining progress bar with, round instead of flooring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.m

    r9488 r9492  
    118118    NSRect result = bounds;
    119119    result.origin.x += PADDING_HORIZONTAL;
    120     result.origin.y += floorf((result.size.height - imageSize) * 0.5f);
     120    result.origin.y += floor((result.size.height - imageSize) * 0.5);
    121121    result.size = NSMakeSize(imageSize, imageSize);
    122122   
     
    162162        result.origin.y += PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
    163163   
    164     result.size.width = round(NSMaxX(bounds) - result.origin.x - PADDING_HORIZONTAL - 2.0f * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
     164    result.size.width = floor(NSMaxX(bounds) - result.origin.x - PADDING_HORIZONTAL - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
    165165   
    166166    return result;
     
    574574    {
    575575        NSRect piecesBarRect, regularBarRect;
    576         NSDivideRect(barRect, &piecesBarRect, &regularBarRect, floorf(NSHeight(barRect) * PIECES_TOTAL_PERCENT * piecesBarPercent),
     576        NSDivideRect(barRect, &piecesBarRect, &regularBarRect, floor(NSHeight(barRect) * PIECES_TOTAL_PERCENT * piecesBarPercent),
    577577                    NSMaxYEdge);
    578578       
     
    596596   
    597597    NSRect haveRect, missingRect;
    598     NSDivideRect(barRect, &haveRect, &missingRect, floorf([torrent progress] * NSWidth(barRect)), NSMinXEdge);
     598    NSDivideRect(barRect, &haveRect, &missingRect, round([torrent progress] * NSWidth(barRect)), NSMinXEdge);
    599599   
    600600    if (!NSIsEmptyRect(haveRect))
     
    607607            {
    608608                NSRect ratioHaveRect, ratioRemainingRect;
    609                 NSDivideRect(haveRect, &ratioHaveRect, &ratioRemainingRect, floorf([torrent progressStopRatio] * NSWidth(haveRect)),
     609                NSDivideRect(haveRect, &ratioHaveRect, &ratioRemainingRect, round([torrent progressStopRatio] * NSWidth(haveRect)),
    610610                            NSMinXEdge);
    611611               
     
    632632    if (![torrent allDownloaded])
    633633    {
    634         const CGFloat widthRemaining = floorf(NSWidth(barRect) * [torrent progressLeft]);
     634        const CGFloat widthRemaining = round(NSWidth(barRect) * [torrent progressLeft]);
    635635       
    636636        NSRect wantedRect;
     
    642642        {
    643643            NSRect unavailableRect;
    644             NSDivideRect(wantedRect, &wantedRect, &unavailableRect, floorf(NSWidth(wantedRect) * [torrent availableDesired]),
     644            NSDivideRect(wantedRect, &wantedRect, &unavailableRect, round(NSWidth(wantedRect) * [torrent availableDesired]),
    645645                        NSMinXEdge);
    646646           
Note: See TracChangeset for help on using the changeset viewer.