mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 13:50:37 +00:00
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:
parent
b03bce8c51
commit
f5851fc4f4
4 changed files with 58 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue