mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:10:48 +00:00
Alot of patches applied from various contributors.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4879 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3d2b84054e
commit
8878d77f92
4 changed files with 97 additions and 19 deletions
23
ChangeLog
23
ChangeLog
|
@ -1,3 +1,26 @@
|
||||||
|
Sun Sep 12 1999 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
|
* Source/NSView.m ([-resizeWithOldSuperviewSize:]): Fixed
|
||||||
|
difficult bug hunted for months: removed floor() used in the
|
||||||
|
middle of the computation of widths and heights. Widths and
|
||||||
|
heights are float, and must not to be arbitrarily rounded to
|
||||||
|
integers in the middle of a computation. This bug would cause
|
||||||
|
obscure, very little, misalignment in various views after resize.
|
||||||
|
The misalignments could become appreciable and ugly after repeated
|
||||||
|
resizes.
|
||||||
|
|
||||||
|
Sun Sep 12 1999 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
|
* Source/NSImageCell.m ([-cellSize]): added method.
|
||||||
|
([-drawingRectForBounds:]): added method.
|
||||||
|
([-drawInteriorWithFrame:inView:]): usual bug fix (see Sep 11).
|
||||||
|
|
||||||
|
1999-09-11 David Lazaro Saz <khelekir@encomix.es>
|
||||||
|
|
||||||
|
* Headers/gnustep/gui/NSGraphics.h: Changed parameter declaration
|
||||||
|
of bordered rectangle drawing functions to conform with MacOS X
|
||||||
|
specs.
|
||||||
|
|
||||||
1999-09-11 Michael Hanni <mhanni@sprintmail.com>
|
1999-09-11 Michael Hanni <mhanni@sprintmail.com>
|
||||||
|
|
||||||
* Source/NSMenu.m: many small fixes and optimizations for quicker
|
* Source/NSMenu.m: many small fixes and optimizations for quicker
|
||||||
|
|
|
@ -80,15 +80,15 @@ void NSRectFillListWithGrays(const NSRect *rects,
|
||||||
//
|
//
|
||||||
// Draw a Bordered Rectangle
|
// Draw a Bordered Rectangle
|
||||||
//
|
//
|
||||||
void NSDrawButton(NSRect aRect, NSRect clipRect);
|
void NSDrawButton(const NSRect aRect, const NSRect clipRect);
|
||||||
void NSDrawGrayBezel(NSRect aRect, NSRect clipRect);
|
void NSDrawGrayBezel(const NSRect aRect, const NSRect clipRect);
|
||||||
void NSDrawGroove(NSRect aRect, NSRect clipRect);
|
void NSDrawGroove(const NSRect aRect, const NSRect clipRect);
|
||||||
NSRect NSDrawTiledRects(NSRect boundsRect, NSRect clipRect,
|
NSRect NSDrawTiledRects(NSRect aRect, const NSRect clipRect,
|
||||||
const NSRectEdge *sides, const float *grays,
|
const NSRectEdge *sides, const float *grays,
|
||||||
int count);
|
int count);
|
||||||
void NSDrawWhiteBezel(NSRect aRect, NSRect clipRect);
|
void NSDrawWhiteBezel(const NSRect aRect, const NSRect clipRect);
|
||||||
void NSFrameRect(NSRect aRect);
|
void NSFrameRect(const NSRect aRect);
|
||||||
void NSFrameRectWithWidth(NSRect aRect, float frameWidth);
|
void NSFrameRectWithWidth(const NSRect aRect, float frameWidth);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get Information About Color Space and Window Depth
|
// Get Information About Color Space and Window Depth
|
||||||
|
|
|
@ -130,7 +130,7 @@
|
||||||
// nada
|
// nada
|
||||||
break;
|
break;
|
||||||
case NSImageFramePhoto:
|
case NSImageFramePhoto:
|
||||||
// what does this one look like?
|
// what does this one look like? TODO (in sync with the rest of the code)
|
||||||
break;
|
break;
|
||||||
case NSImageFrameGrayBezel:
|
case NSImageFrameGrayBezel:
|
||||||
NSDrawGrayBezel(cellFrame, NSZeroRect);
|
NSDrawGrayBezel(cellFrame, NSZeroRect);
|
||||||
|
@ -209,7 +209,7 @@ static inline NSSize scaleProportionally(NSSize imageSize, NSRect canvasRect)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// leave room for the frame
|
// leave room for the frame
|
||||||
cellFrame = NSInsetRect(cellFrame, xDist, yDist);
|
cellFrame = [self drawingRectForBounds: cellFrame];
|
||||||
|
|
||||||
switch( [self imageScaling] )
|
switch( [self imageScaling] )
|
||||||
{
|
{
|
||||||
|
@ -289,6 +289,67 @@ static inline NSSize scaleProportionally(NSSize imageSize, NSRect canvasRect)
|
||||||
[image compositeToPoint: position operation: NSCompositeCopy];
|
[image compositeToPoint: position operation: NSCompositeCopy];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSSize) cellSize
|
||||||
|
{
|
||||||
|
NSSize borderSize, s;
|
||||||
|
|
||||||
|
// Get border size
|
||||||
|
switch (_frameStyle)
|
||||||
|
{
|
||||||
|
case NSImageFrameNone:
|
||||||
|
borderSize = [NSCell sizeForBorderType: NSNoBorder];
|
||||||
|
break;
|
||||||
|
case NSImageFramePhoto:
|
||||||
|
// what does this one look like? TODO (in sync with the rest of the code)
|
||||||
|
borderSize = [NSCell sizeForBorderType: NSNoBorder];
|
||||||
|
break;
|
||||||
|
case NSImageFrameGrayBezel:
|
||||||
|
case NSImageFrameGroove:
|
||||||
|
case NSImageFrameButton:
|
||||||
|
borderSize = [NSCell sizeForBorderType: NSBezelBorder];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get Content Size
|
||||||
|
s = _original_image_size;
|
||||||
|
|
||||||
|
// Add in border size
|
||||||
|
s.width += 2 * borderSize.width;
|
||||||
|
s.height += 2 * borderSize.height;
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSSize) cellSizeForBounds: (NSRect)aRect
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return NSZeroSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSRect) drawingRectForBounds: (NSRect)theRect
|
||||||
|
{
|
||||||
|
NSSize borderSize;
|
||||||
|
|
||||||
|
// Get border size
|
||||||
|
switch (_frameStyle)
|
||||||
|
{
|
||||||
|
case NSImageFrameNone:
|
||||||
|
borderSize = [NSCell sizeForBorderType: NSNoBorder];
|
||||||
|
break;
|
||||||
|
case NSImageFramePhoto:
|
||||||
|
// what does this one look like? TODO (in sync with the rest of the code)
|
||||||
|
borderSize = [NSCell sizeForBorderType: NSNoBorder];
|
||||||
|
break;
|
||||||
|
case NSImageFrameGrayBezel:
|
||||||
|
case NSImageFrameGroove:
|
||||||
|
case NSImageFrameButton:
|
||||||
|
borderSize = [NSCell sizeForBorderType: NSBezelBorder];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NSInsetRect (theRect, borderSize.width, borderSize.height);
|
||||||
|
}
|
||||||
|
|
||||||
- (id) copyWithZone: (NSZone *)zone
|
- (id) copyWithZone: (NSZone *)zone
|
||||||
{
|
{
|
||||||
NSImageCell *c = [super copyWithZone: zone];
|
NSImageCell *c = [super copyWithZone: zone];
|
||||||
|
|
|
@ -1041,7 +1041,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
if (options >= 1)
|
if (options >= 1)
|
||||||
{
|
{
|
||||||
change = superViewFrameSize.width - oldSize.width;
|
change = superViewFrameSize.width - oldSize.width;
|
||||||
changePerOption = floor(change/options);
|
changePerOption = change/options;
|
||||||
|
|
||||||
if (autoresizingMask & NSViewWidthSizable)
|
if (autoresizingMask & NSViewWidthSizable)
|
||||||
{
|
{
|
||||||
|
@ -1049,10 +1049,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
|
|
||||||
frame.size.width += changePerOption;
|
frame.size.width += changePerOption;
|
||||||
if (is_rotated_or_scaled_from_base)
|
if (is_rotated_or_scaled_from_base)
|
||||||
{
|
bounds.size.width *= frame.size.width/oldFrameWidth;
|
||||||
bounds.size.width *= frame.size.width/oldFrameWidth;
|
|
||||||
bounds.size.width = floor(bounds.size.width);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
bounds.size.width += changePerOption;
|
bounds.size.width += changePerOption;
|
||||||
changedSize = YES;
|
changedSize = YES;
|
||||||
|
@ -1081,7 +1078,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
if (options >= 1)
|
if (options >= 1)
|
||||||
{
|
{
|
||||||
change = superViewFrameSize.height - oldSize.height;
|
change = superViewFrameSize.height - oldSize.height;
|
||||||
changePerOption = floor(change/options);
|
changePerOption = change/options;
|
||||||
|
|
||||||
if (autoresizingMask & NSViewHeightSizable)
|
if (autoresizingMask & NSViewHeightSizable)
|
||||||
{
|
{
|
||||||
|
@ -1089,10 +1086,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
|
|
||||||
frame.size.height += changePerOption;
|
frame.size.height += changePerOption;
|
||||||
if (is_rotated_or_scaled_from_base)
|
if (is_rotated_or_scaled_from_base)
|
||||||
{
|
bounds.size.height *= frame.size.height/oldFrameHeight;
|
||||||
bounds.size.height *= frame.size.height/oldFrameHeight;
|
|
||||||
bounds.size.height = floor(bounds.size.height);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
bounds.size.height += changePerOption;
|
bounds.size.height += changePerOption;
|
||||||
changedSize = YES;
|
changedSize = YES;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue