Author: mlytwyn
Date: Tue Mar 15 17:35:08 2016
New Revision: 39543
URL: http://svn.gna.org/viewcvs/gnustep?rev=39543&view=rev
Log:
Reinstate image resize on button image
Modified:
libs/gui/branches/gnustep_testplant_branch/Source/NSButtonCell.m
Modified: libs/gui/branches/gnustep_testplant_branch/Source/NSButtonCell.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/gnustep_testplant_branch/Source/NSButtonCell.m?rev=39543&r1=39542&r2=39543&view=diff
==============================================================================
--- libs/gui/branches/gnustep_testplant_branch/Source/NSButtonCell.m
(original)
+++ libs/gui/branches/gnustep_testplant_branch/Source/NSButtonCell.m Tue Mar
15 17:35:08 2016
@@ -1021,9 +1021,17 @@
NSPoint offset;
NSRect rect;
CGFloat fraction;
+
+ // TESTPLANT-MAL-2016: Button images are too big within the button frames
+ // Remove this code at your own peril...
+ // Make sure image does not exceed or touch our frame...
+ // Not the best solution so have at it if you have a better one...
+ if ([self imagePosition] == NSImageOnly)
+ cellFrame = NSInsetRect(cellFrame, 4, 4);
+
NSSize size = [self _scaleImageWithSize: [imageToDisplay size]
- toFitInSize: cellFrame.size
- scalingType: _imageScaling];
+ toFitInSize: cellFrame.size
+ scalingType: _imageScaling];
/* Calculate an offset from the cellFrame origin */
offset = NSMakePoint((NSWidth(cellFrame) - size.width) / 2.0,
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs