- The range is clipped to maxRows in rectForRowsInRange: - The range is clipped to maxColumns in rectForColumnsInRange:

git-svn-id: http://macvim.googlecode.com/svn/trunk@35 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
Bjorn Winckler
2007-07-29 17:10:05 +00:00
parent a2405dbee9
commit c2b80619a0
+14 -4
View File
@@ -471,8 +471,13 @@
NSLayoutManager *lm = [[self layoutManagers] objectAtIndex:0];
float fontHeight = [lm defaultLineHeightForFont:font];
rect.origin.y = fontHeight * range.location;
rect.size.height = fontHeight * range.length;
unsigned start = range.location > maxRows ? maxRows : range.location;
unsigned length = range.length;
if (start+length > maxRows)
length = maxRows - start;
rect.origin.y = fontHeight * start;
rect.size.height = fontHeight * length;
return rect;
}
@@ -483,8 +488,13 @@
float fontWidth = maxColumns > 0
? [self widthOfEmptyRow]/maxColumns : 0;
rect.origin.x = fontWidth * range.location;
rect.size.width = fontWidth * range.length;
unsigned start = range.location > maxColumns ? maxColumns : range.location;
unsigned length = range.length;
if (start+length > maxColumns)
length = maxColumns - start;
rect.origin.x = fontWidth * start;
rect.size.width = fontWidth * length;
return rect;
}