mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 14:30:54 +00:00
Reinstate image resize on button image
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@39543 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
37d1868b99
commit
c2d0733e18
1 changed files with 10 additions and 2 deletions
|
@ -1021,9 +1021,17 @@ typedef struct _GSButtonCellFlags
|
||||||
NSPoint offset;
|
NSPoint offset;
|
||||||
NSRect rect;
|
NSRect rect;
|
||||||
CGFloat fraction;
|
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]
|
NSSize size = [self _scaleImageWithSize: [imageToDisplay size]
|
||||||
toFitInSize: cellFrame.size
|
toFitInSize: cellFrame.size
|
||||||
scalingType: _imageScaling];
|
scalingType: _imageScaling];
|
||||||
|
|
||||||
/* Calculate an offset from the cellFrame origin */
|
/* Calculate an offset from the cellFrame origin */
|
||||||
offset = NSMakePoint((NSWidth(cellFrame) - size.width) / 2.0,
|
offset = NSMakePoint((NSWidth(cellFrame) - size.width) / 2.0,
|
||||||
|
|
Loading…
Reference in a new issue