mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
- 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:
+14
-4
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user