Applied view resizing patches.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8345 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-12-18 10:52:46 +00:00
parent 418f373144
commit e514763173
2 changed files with 21 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2000-12-17 Georg Fleischmann
* gui/Source/NSView.m ([NSView -setFrameSize:]):
scale bounds, if necessary
* gui/Source/NSView.m ([NSView -scaleUnitSquareSize:]):
scale from bounds instead of frame (like OpenStep)
Sun Dec 17 14:32:11 2000 Nicola Pero <n.pero@mi.flashnet.it>
* Source/NSCell.m ([-_nonAutoreleasedTypingAttributes]): New

View file

@ -699,7 +699,18 @@ GSSetDragTypes(NSView* obj, NSArray *types)
{
(*invalidateImp)(self, invalidateSel);
}
_frame.size = _bounds.size = newSize;
if (_is_rotated_or_scaled_from_base)
{
float sx = _bounds.size.width / _frame.size.width;
float sy = _bounds.size.height / _frame.size.height;
_frame.size = newSize;
_bounds.size.width = _frame.size.width * sx;
_bounds.size.height = _frame.size.height * sy;
}
else
_frame.size = _bounds.size = newSize;
[self resizeSubviewsWithOldSize: old_size];
if (_post_frame_changes)
@ -761,8 +772,8 @@ GSSetDragTypes(NSView* obj, NSArray *types)
{
(*invalidateImp)(self, invalidateSel);
}
_bounds.size.width = _frame.size.width / newSize.width;
_bounds.size.height = _frame.size.height / newSize.height;
_bounds.size.width = _bounds.size.width / newSize.width;
_bounds.size.height = _bounds.size.height / newSize.height;
_is_rotated_or_scaled_from_base = YES;