mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
minor compiler compatibility
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34183 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
98e188a767
commit
115a372c27
2 changed files with 15 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
2011-11-17 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Source/NSButtonCell.m:
|
||||
Minor compiler compatibility.
|
||||
|
||||
2011-11-16 Quentin Mathe <quentin.mathe@gmail.com>
|
||||
|
||||
Improved the menu theming to support some common menu look variations.
|
||||
|
|
|
@ -983,6 +983,9 @@ typedef struct _GSButtonCellFlags
|
|||
// Draw image
|
||||
if (imageToDisplay != nil)
|
||||
{
|
||||
NSPoint offset;
|
||||
NSRect rect;
|
||||
CGFloat fraction;
|
||||
NSSize size = [self _scaleImageWithSize: [imageToDisplay size]
|
||||
toFitInSize: cellFrame.size
|
||||
scalingType: _imageScaling];
|
||||
|
@ -999,7 +1002,7 @@ typedef struct _GSButtonCellFlags
|
|||
|
||||
/* Calculate an offset from the cellFrame origin */
|
||||
|
||||
NSPoint offset = NSMakePoint((NSWidth(cellFrame) - size.width) / 2.0,
|
||||
offset = NSMakePoint((NSWidth(cellFrame) - size.width) / 2.0,
|
||||
(NSHeight(cellFrame) - size.height) / 2.0);
|
||||
|
||||
/* Pixel-align the offset */
|
||||
|
@ -1024,12 +1027,12 @@ typedef struct _GSButtonCellFlags
|
|||
|
||||
/* Draw the image */
|
||||
|
||||
const NSRect rect = NSMakeRect(cellFrame.origin.x + offset.x,
|
||||
cellFrame.origin.y + offset.y,
|
||||
size.width,
|
||||
size.height);
|
||||
const CGFloat fraction = (![self isEnabled] &&
|
||||
[self imageDimsWhenDisabled]) ? 0.5 : 1.0;
|
||||
rect = NSMakeRect(cellFrame.origin.x + offset.x,
|
||||
cellFrame.origin.y + offset.y,
|
||||
size.width,
|
||||
size.height);
|
||||
fraction = (![self isEnabled] &&
|
||||
[self imageDimsWhenDisabled]) ? 0.5 : 1.0;
|
||||
|
||||
[imageToDisplay drawInRect: rect
|
||||
fromRect: NSZeroRect
|
||||
|
|
Loading…
Reference in a new issue