mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Fix drawing ref labels on the next tableview column
If there are a large number of refs pointing to a commit, then they may be drawn on top of or behind the other columns. This will not show any labels that don't fit.
This commit is contained in:
committed by
Dave Grijalva
parent
1917bca23b
commit
5ea536be97
+7
-5
@@ -149,8 +149,8 @@
|
||||
static const int ref_spacing = 2;
|
||||
|
||||
NSRect lastRect = rect;
|
||||
lastRect.origin.x = round(lastRect.origin.x) - 0.5;
|
||||
lastRect.origin.y = round(lastRect.origin.y) - 0.5;
|
||||
lastRect.origin.x = round(lastRect.origin.x) + 0.5;
|
||||
lastRect.origin.y = round(lastRect.origin.y) + 0.5;
|
||||
|
||||
for (PBGitRef *ref in self.objectValue.refs) {
|
||||
NSMutableDictionary* attributes = [self attributesForRefLabelSelected:NO];
|
||||
@@ -161,9 +161,11 @@
|
||||
newRect.size.height = textSize.height;
|
||||
newRect.origin.y = rect.origin.y + (rect.size.height - newRect.size.height) / 2;
|
||||
|
||||
[array addObject:[NSValue valueWithRect:newRect]];
|
||||
lastRect = newRect;
|
||||
lastRect.origin.x += (int)lastRect.size.width + ref_spacing;
|
||||
if (NSContainsRect(rect, newRect)) {
|
||||
[array addObject:[NSValue valueWithRect:newRect]];
|
||||
lastRect = newRect;
|
||||
lastRect.origin.x += (int)lastRect.size.width + ref_spacing;
|
||||
}
|
||||
}
|
||||
|
||||
return array;
|
||||
|
||||
Reference in New Issue
Block a user