mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Little improvement of the description of the _GNULineLayoutInfo objects -
changing mainly using for debugging git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10818 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
64720d2a5e
commit
63d0ee2c7c
1 changed files with 13 additions and 13 deletions
|
@ -102,11 +102,10 @@ static NSCharacterSet *invSelectionWordGranularitySet;
|
|||
|
||||
- (NSString*) description
|
||||
{
|
||||
return [[NSDictionary dictionaryWithObjectsAndKeys:
|
||||
NSStringFromRange(glyphRange), @"GlyphRange",
|
||||
NSStringFromRect(lineFragmentRect), @"LineFragmentRect",
|
||||
nil]
|
||||
description];
|
||||
return [NSString stringWithFormat: @"_GNULineLayoutInfo with glyphRange: %@, lineFragmentRect: %@, usedRect: %@",
|
||||
NSStringFromRange (glyphRange),
|
||||
NSStringFromRect (lineFragmentRect),
|
||||
NSStringFromRect (usedRect)];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -292,8 +291,7 @@ static NSCharacterSet *invSelectionWordGranularitySet;
|
|||
float x;
|
||||
unsigned start;
|
||||
_GNULineLayoutInfo *currentInfo;
|
||||
NSRect rect;
|
||||
|
||||
|
||||
if (![_textStorage length] || ![_lineLayoutInformation count])
|
||||
{
|
||||
return NSMakePoint(0, 0);
|
||||
|
@ -302,15 +300,17 @@ static NSCharacterSet *invSelectionWordGranularitySet;
|
|||
currentInfo = [_lineLayoutInformation
|
||||
objectAtIndex: [self lineLayoutIndexForGlyphIndex:
|
||||
index]];
|
||||
if (index >= NSMaxRange(currentInfo->glyphRange))
|
||||
return NSMakePoint(NSMaxX(currentInfo->usedRect), 0);
|
||||
|
||||
if (index >= NSMaxRange (currentInfo->glyphRange))
|
||||
{
|
||||
return NSMakePoint (NSMaxX (currentInfo->usedRect), 0);
|
||||
}
|
||||
|
||||
start = currentInfo->glyphRange.location;
|
||||
rect = currentInfo->lineFragmentRect;
|
||||
x = [self _sizeOfRange: NSMakeRange(start, index-start)].width;
|
||||
x = [self _sizeOfRange: (NSMakeRange (start, index - start))].width;
|
||||
|
||||
/* NB: As per specs, we return the location relative to the glyph's
|
||||
line fragment rectangle */
|
||||
return NSMakePoint(x, 0);
|
||||
// return NSMakePoint(rect.origin.x + x, rect.origin.y);
|
||||
}
|
||||
|
||||
- (NSRect)boundingRectForGlyphRange:(NSRange)aRange
|
||||
|
|
Loading…
Reference in a new issue