Add -_didInvalidateLayout method that is called whenever any layout information has been invalidated. Use it in NSLayoutManager to resize text views.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15915 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
alexm 2003-02-09 17:05:18 +00:00
parent b03bce8c51
commit f5851fc4f4
4 changed files with 58 additions and 5 deletions

View file

@ -1450,9 +1450,6 @@ TODO: not really clear what these should do
changeInLength: (int)lengthChange
invalidatedRange: (NSRange)invalidatedRange
{
unsigned int g;
int i;
[super textStorage: aTextStorage
edited: mask
range: range
@ -1490,22 +1487,31 @@ TODO: not really clear what these should do
}
}
}
}
-(void) _didInvalidateLayout
{
unsigned int g;
int i;
/* Invalidate display from the first glyph not laid out (which will
generally be the first glyph to have been invalidated). */
g = layout_glyph;
[super _didInvalidateLayout];
for (i = 0; i < num_textcontainers; i++)
{
if (textcontainers[i].complete &&
g < textcontainers[i].pos + textcontainers[i].length)
continue;
[[textcontainers[i].textContainer textView] sizeToFit]; /* TODO? */
[[textcontainers[i].textContainer textView] sizeToFit];
[[textcontainers[i].textContainer textView] setNeedsDisplay: YES];
}
}
@end