Skip to content

Commit

Permalink
Preserve rectangle for drawing subject if refs too long
Browse files Browse the repository at this point in the history
If the column for presenting refs is not wide enough to actually draw
any refs, the rectangle we started with that accounted for the history
lines already should not be adjusted with the rect(0,0,0,0).

In useful sized columns that zero rect would be updated as refs that can
be drawn are drawn ensuring the subject appears to the right.
  • Loading branch information
mczepiel committed May 30, 2012
1 parent facc1da commit 1f6af26
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Classes/Views/PBGitRevisionCell.m
Expand Up @@ -218,8 +218,13 @@ - (void) drawRefsInRect: (NSRect *)refRect
lastRect = rect;
++index;
}
refRect->size.width -= lastRect.origin.x - refRect->origin.x + lastRect.size.width;
refRect->origin.x = lastRect.origin.x + lastRect.size.width;

// Only update rect to account for drawn refs if necessary to push
// subsequent content to the right.
if (index > 0) {
refRect->size.width -= lastRect.origin.x - refRect->origin.x + lastRect.size.width;
refRect->origin.x = lastRect.origin.x + lastRect.size.width;
}
}

- (void) drawWithFrame: (NSRect) rect inView:(NSView *)view
Expand Down

0 comments on commit 1f6af26

Please sign in to comment.