mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Implement rectsForCharacterRange: per example for firstRectForCharacterRange:
This commit is contained in:
parent
fe50e9f40a
commit
a02336f84f
1 changed files with 20 additions and 2 deletions
|
@ -6137,8 +6137,26 @@ configuation! */
|
|||
|
||||
- (NSArray *) rectsForCharacterRange: (NSRange)range
|
||||
{
|
||||
NSValue *value = [NSValue valueWithRect: [self rectForCharacterRange: range]];
|
||||
NSArray *result = [NSArray arrayWithObject: value];
|
||||
NSUInteger rectCount = 0;
|
||||
NSRect *rects;
|
||||
NSMutableArray *result = [NSMutableArray array];
|
||||
|
||||
if (_layoutManager)
|
||||
{
|
||||
NSUInteger idx = 0;
|
||||
rects = [_layoutManager rectArrayForCharacterRange: range
|
||||
withinSelectedCharacterRange: NSMakeRange(NSNotFound, 0)
|
||||
inTextContainer: _textContainer
|
||||
rectCount: &rectCount];
|
||||
|
||||
for(idx = 0; idx < rectCount; idx++)
|
||||
{
|
||||
NSRect r = rects[idx];
|
||||
NSValue *v = [NSValue valueWithRect: r];
|
||||
[result addObject: v];
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue