Change a few instances of floorf/fabsf → floor/fabs

This commit is contained in:
Allan Odgaard
2014-03-28 11:07:01 +07:00
parent 6d6210e490
commit 619a2cfec7
7 changed files with 7 additions and 7 deletions

View File

@@ -102,7 +102,7 @@
- (void)scrollWheel:(NSEvent*)anEvent
{
if(![NSEvent isSwipeTrackingFromScrollEventsEnabled] || [anEvent phase] == NSEventPhaseNone || fabsf([anEvent scrollingDeltaX]) <= fabsf([anEvent scrollingDeltaY]))
if(![NSEvent isSwipeTrackingFromScrollEventsEnabled] || [anEvent phase] == NSEventPhaseNone || fabs([anEvent scrollingDeltaX]) <= fabs([anEvent scrollingDeltaY]))
return;
[anEvent trackSwipeEventWithOptions:0 dampenAmountThresholdMin:(_webView.canGoForward ? -1 : 0) max:(_webView.canGoBack ? +1 : 0) usingHandler:^(CGFloat gestureAmount, NSEventPhase phase, BOOL isComplete, BOOL* stop) {

View File

@@ -376,7 +376,7 @@ static void* kOakPasteboardChooserCurrentEntryBinding = &kOakPasteboardChooserCu
}
}
- (int)visibleRows { return (int)floorf(NSHeight([_tableView visibleRect]) / ([_tableView rowHeight]+[_tableView intercellSpacing].height)) - 1; }
- (int)visibleRows { return (int)floor(NSHeight([_tableView visibleRect]) / ([_tableView rowHeight]+[_tableView intercellSpacing].height)) - 1; }
- (void)moveUp:(id)sender { [self moveSelectedRowByOffset:-1 extendingSelection:NO]; }
- (void)moveDown:(id)sender { [self moveSelectedRowByOffset:+1 extendingSelection:NO]; }

View File

@@ -254,7 +254,7 @@ static size_t line_count (std::string const& text)
}
}
- (int)visibleRows { return (int)floorf(NSHeight([tableView visibleRect]) / ([tableView rowHeight]+[tableView intercellSpacing].height)) - 1; }
- (int)visibleRows { return (int)floor(NSHeight([tableView visibleRect]) / ([tableView rowHeight]+[tableView intercellSpacing].height)) - 1; }
- (void)moveUp:(id)sender { [self moveSelectedRowByOffset:-1]; }
- (void)moveDown:(id)sender { [self moveSelectedRowByOffset:+1];}

View File

@@ -122,7 +122,7 @@
- (NSUInteger)characterIndexForPoint:(NSPoint)thePoint
{
NSUInteger index = floorf([self convertPoint:[[self window] convertScreenToBase:thePoint] fromView:nil].x / 7.0f);
NSUInteger index = floor([self convertPoint:[[self window] convertScreenToBase:thePoint] fromView:nil].x / 7.0f);
NSLog(@"%s %@ (%lu)", sel_getName(_cmd), NSStringFromPoint(thePoint), index);
return index;
}

View File

@@ -1193,7 +1193,7 @@ static NSMutableSet* SymmetricDifference (NSMutableSet* aSet, NSMutableSet* anot
- (void)scrollWheel:(NSEvent*)anEvent
{
if(![NSEvent isSwipeTrackingFromScrollEventsEnabled] || [anEvent phase] == NSEventPhaseNone || fabsf([anEvent scrollingDeltaX]) <= fabsf([anEvent scrollingDeltaY]))
if(![NSEvent isSwipeTrackingFromScrollEventsEnabled] || [anEvent phase] == NSEventPhaseNone || fabs([anEvent scrollingDeltaX]) <= fabs([anEvent scrollingDeltaY]))
return;
[anEvent trackSwipeEventWithOptions:0 dampenAmountThresholdMin:(self.canGoForward ? -1 : 0) max:(self.canGoBack ? +1 : 0) usingHandler:^(CGFloat gestureAmount, NSEventPhase phase, BOOL isComplete, BOOL* stop) {

View File

@@ -169,7 +169,7 @@
}
}
- (int)visibleRows { return (int)floorf(NSHeight([filterView visibleRect]) / ([filterView rowHeight]+[filterView intercellSpacing].height)) - 1; }
- (int)visibleRows { return (int)floor(NSHeight([filterView visibleRect]) / ([filterView rowHeight]+[filterView intercellSpacing].height)) - 1; }
- (void)moveUp:(id)sender { [self moveSelectedRowByOffset:-1 extendingSelection:NO]; }
- (void)moveDown:(id)sender { [self moveSelectedRowByOffset:+1 extendingSelection:NO]; }

View File

@@ -43,7 +43,7 @@ APPKIT_EXTERN NSString *const NSAccessibilityAnnouncementKey NS_AVAIL
}
}
- (int)visibleRows { return (int)floorf(NSHeight([_tableView visibleRect]) / ([_tableView rowHeight]+[_tableView intercellSpacing].height)) - 1; }
- (int)visibleRows { return (int)floor(NSHeight([_tableView visibleRect]) / ([_tableView rowHeight]+[_tableView intercellSpacing].height)) - 1; }
- (void)moveUp:(id)sender { [self moveSelectedRowByOffset:-1 extendingSelection:NO sender:sender]; }
- (void)moveDown:(id)sender { [self moveSelectedRowByOffset:+1 extendingSelection:NO sender:sender]; }