mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
[GSSimpleLayoutManager boundingRectForGlyphRange:inTextContainer:]:
Use lineFragmentRect instead of usedRect, so that the full line gets cleared. This still is not correct for all cases. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10955 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2f8b4e7389
commit
632ec4278e
1 changed files with 7 additions and 3 deletions
|
@ -316,7 +316,6 @@ static NSCharacterSet *invSelectionWordGranularitySet;
|
|||
- (NSRect)boundingRectForGlyphRange:(NSRange)aRange
|
||||
inTextContainer:(NSTextContainer *)aTextContainer;
|
||||
{
|
||||
float width = [aTextContainer containerSize].width;
|
||||
_GNULineLayoutInfo *currentInfo;
|
||||
unsigned i1, i2;
|
||||
NSRect rect1;
|
||||
|
@ -331,12 +330,17 @@ static NSCharacterSet *invSelectionWordGranularitySet;
|
|||
|
||||
// This is not exacty what we need, but should be correct enough
|
||||
currentInfo = [_lineLayoutInformation objectAtIndex: i1];
|
||||
rect1 = currentInfo->usedRect;
|
||||
rect1 = currentInfo->lineFragmentRect;
|
||||
|
||||
if (i1 != i2)
|
||||
{
|
||||
currentInfo = [_lineLayoutInformation objectAtIndex: i2];
|
||||
rect1 = NSUnionRect(rect1, currentInfo->usedRect);
|
||||
rect1 = NSUnionRect(rect1, currentInfo->lineFragmentRect);
|
||||
}
|
||||
else
|
||||
{
|
||||
//float width = [aTextContainer containerSize].width;
|
||||
// FIXME: When we are on one line we may need only part of it
|
||||
}
|
||||
|
||||
return rect1;
|
||||
|
|
Loading…
Reference in a new issue