Revision: 29116 http://sourceforge.net/p/bibdesk/svn/29116 Author: hofman Date: 2025-04-17 09:35:47 +0000 (Thu, 17 Apr 2025) Log Message: ----------- Directly use some default values in layout calculation
Modified Paths: -------------- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m =================================================================== --- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-17 09:04:37 UTC (rev 29115) +++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-17 09:35:47 UTC (rev 29116) @@ -1224,10 +1224,10 @@ // make sure fractional widths won't bring back scrollers width = floor(width); // guess the iconScale, ignoring the variable padding because that depends on the iconScale - CGFloat iconScale = fmax( MIN_AUTO_ICON_SCALE, ( ( width - 2 * DEFAULT_MARGIN.width ) / _numberOfColumns - [self _paddingForScale:0.0].width ) / ( DEFAULT_ICON_SIZE.width + PADDING_STRETCH )); + CGFloat iconScale = fmax( MIN_AUTO_ICON_SCALE, ( ( width - 2 * DEFAULT_MARGIN.width ) / _numberOfColumns - DEFAULT_PADDING.width ) / ( DEFAULT_ICON_SIZE.width + PADDING_STRETCH )); _padding = [self _paddingForScale:iconScale]; // recalculate exactly based on this padding, inverting the calculation in _frameWidth - iconScale = fmax( MIN_AUTO_ICON_SCALE, ( ( width - [self _leftMargin] - [self _rightMargin] + _padding.width ) / _numberOfColumns - _padding.width ) / DEFAULT_ICON_SIZE.width ); + iconScale = fmax( MIN_AUTO_ICON_SCALE, ( ( width - 2 * DEFAULT_MARGIN.width ) / _numberOfColumns - _padding.width ) / DEFAULT_ICON_SIZE.width ); _iconSize = NSMakeSize(iconScale * DEFAULT_ICON_SIZE.width, iconScale * DEFAULT_ICON_SIZE.height); } @@ -1235,10 +1235,10 @@ // make sure fractional heights won't bring back scrollers height = floor(height); // guess the iconScale, ignoring the variable padding because that depends on the iconScale - CGFloat iconScale = fmax( MIN_AUTO_ICON_SCALE, ( ( height - DEFAULT_MARGIN.height ) / _numberOfRows - [self _paddingForScale:0.0].height ) / ( DEFAULT_ICON_SIZE.height + PADDING_STRETCH ) ); + CGFloat iconScale = fmax( MIN_AUTO_ICON_SCALE, ( ( height - DEFAULT_MARGIN.height ) / _numberOfRows - DEFAULT_PADDING.height - [self _textHeight] ) / ( DEFAULT_ICON_SIZE.height + PADDING_STRETCH ) ); _padding = [self _paddingForScale:iconScale]; // recalculate exactly based on this padding, inverting the calculation in _frameHeight - iconScale = fmax( MIN_AUTO_ICON_SCALE, ( ( height - [self _topMargin] - [self _bottomMargin] ) / _numberOfRows - _padding.height ) / DEFAULT_ICON_SIZE.height ); + iconScale = fmax( MIN_AUTO_ICON_SCALE, ( ( height - DEFAULT_MARGIN.height ) / _numberOfRows - _padding.height ) / DEFAULT_ICON_SIZE.height ); _iconSize = NSMakeSize(iconScale * DEFAULT_ICON_SIZE.width, iconScale * DEFAULT_ICON_SIZE.height); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Bibdesk-commit mailing list Bibdesk-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-commit