Revision: 29117 http://sourceforge.net/p/bibdesk/svn/29117 Author: hofman Date: 2025-04-17 09:45:20 +0000 (Thu, 17 Apr 2025) Log Message: ----------- partial calculation first
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:35:47 UTC (rev 29116) +++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2025-04-17 09:45:20 UTC (rev 29117) @@ -1222,23 +1222,23 @@ - (void)_setPaddingAndIconSizeFromContentWidth:(CGFloat)width { // make sure fractional widths won't bring back scrollers - width = floor(width); + CGFloat colWidth = ( floor(width) - 2 * DEFAULT_MARGIN.width ) / _numberOfColumns; // 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 - DEFAULT_PADDING.width ) / ( DEFAULT_ICON_SIZE.width + PADDING_STRETCH )); + CGFloat iconScale = fmax( MIN_AUTO_ICON_SCALE, ( colWidth - 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 - 2 * DEFAULT_MARGIN.width ) / _numberOfColumns - _padding.width ) / DEFAULT_ICON_SIZE.width ); + iconScale = fmax( MIN_AUTO_ICON_SCALE, ( colWidth - _padding.width ) / DEFAULT_ICON_SIZE.width ); _iconSize = NSMakeSize(iconScale * DEFAULT_ICON_SIZE.width, iconScale * DEFAULT_ICON_SIZE.height); } - (void)_setPaddingAndIconSizeFromContentHeight:(CGFloat)height { // make sure fractional heights won't bring back scrollers - height = floor(height); + CGFloat colHeight = ( floor(height) - DEFAULT_MARGIN.height ) / _numberOfRows; // 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 - DEFAULT_PADDING.height - [self _textHeight] ) / ( DEFAULT_ICON_SIZE.height + PADDING_STRETCH ) ); + CGFloat iconScale = fmax( MIN_AUTO_ICON_SCALE, ( colHeight - 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 - DEFAULT_MARGIN.height ) / _numberOfRows - _padding.height ) / DEFAULT_ICON_SIZE.height ); + iconScale = fmax( MIN_AUTO_ICON_SCALE, ( colHeight - _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