Revision: 25366 http://sourceforge.net/p/bibdesk/svn/25366 Author: hofman Date: 2021-01-11 23:50:48 +0000 (Mon, 11 Jan 2021) Log Message: ----------- Fix caluclation of rect for scale slider
Modified Paths: -------------- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m =================================================================== --- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2021-01-11 17:01:27 UTC (rev 25365) +++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m 2021-01-11 23:50:48 UTC (rev 25366) @@ -1531,10 +1531,10 @@ - (NSRect)_topSliderRect { NSRect r = [self visibleRect]; - CGFloat l = floor( NSMidX(r) - fmax( MIN_SLIDER_WIDTH / 2, fmin( MAX_SLIDER_WIDTH / 2, NSWidth(r) / 5 ) ) ); - r.origin.x += l; + CGFloat w = fmax( MIN_SLIDER_WIDTH, fmin( MAX_SLIDER_WIDTH, ceil( 0.4 * NSWidth(r) ) ) ); + r.origin.x = floor(NSMidX(r) - 0.5 * w); r.origin.y += TOP_SLIDER_OFFSET; - r.size.width -= 2 * l; + r.size.width = w; r.size.height = SLIDER_HEIGHT; return r; } @@ -1542,10 +1542,10 @@ - (NSRect)_bottomSliderRect { NSRect r = [self visibleRect]; - CGFloat l = floor( NSMidX(r) - fmax( MIN_SLIDER_WIDTH / 2, fmin( MAX_SLIDER_WIDTH / 2, NSWidth(r) / 5 ) ) ); - r.origin.x += l; + CGFloat w = fmax( MIN_SLIDER_WIDTH, fmin( MAX_SLIDER_WIDTH, ceil( 0.4 * NSWidth(r) ) ) ); + r.origin.x = floor(NSMidX(r) - 0.5 * w); r.origin.y += NSHeight(r) - BOTTOM_SLIDER_OFFSET; - r.size.width -= 2 * l; + r.size.width = w; r.size.height = SLIDER_HEIGHT; return r; } 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