mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 13:30:37 +00:00
fix drawing bug when number of rows decreases
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29065 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
97d1907a52
commit
82d1ada3dc
4 changed files with 32 additions and 20 deletions
|
@ -4414,6 +4414,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
|||
- (void) setFrame: (NSRect)frameRect
|
||||
{
|
||||
NSRect tmpRect = frameRect;
|
||||
|
||||
if ([_super_view respondsToSelector: @selector(documentVisibleRect)])
|
||||
{
|
||||
float rowsHeight = ((_numberOfRows * _rowHeight) + 1);
|
||||
|
@ -4758,6 +4759,8 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
|||
|
||||
- (void) noteNumberOfRowsChanged
|
||||
{
|
||||
NSRect newFrame;
|
||||
|
||||
_numberOfRows = [self _numRows];
|
||||
|
||||
/* If we are selecting rows, we have to check that we have no
|
||||
|
@ -4832,10 +4835,13 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
|||
}
|
||||
}
|
||||
|
||||
[self setFrame: NSMakeRect (_frame.origin.x,
|
||||
_frame.origin.y,
|
||||
_frame.size.width,
|
||||
(_numberOfRows * _rowHeight) + 1)];
|
||||
newFrame = _frame;
|
||||
newFrame.size.height = (_numberOfRows * _rowHeight) + 1;
|
||||
if (NO == NSEqualRects(newFrame, NSUnionRect(newFrame, _frame)))
|
||||
{
|
||||
[_super_view setNeedsDisplayInRect: _frame];
|
||||
}
|
||||
[self setFrame: newFrame];
|
||||
|
||||
/* If we are shorter in height than the enclosing clipview, we
|
||||
should redraw us now. */
|
||||
|
@ -4844,7 +4850,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
|
|||
NSRect superviewBounds; // Get this *after* [self setFrame:]
|
||||
superviewBounds = [_super_view bounds];
|
||||
if ((superviewBounds.origin.x <= _frame.origin.x)
|
||||
&& (NSMaxY(superviewBounds) >= NSMaxY(_frame)))
|
||||
&& (NSMaxY(superviewBounds) >= NSMaxY(_frame)))
|
||||
{
|
||||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue