Revision: 5328
http://skim-app.svn.sourceforge.net/skim-app/?rev=5328&view=rev
Author: hofman
Date: 2009-04-25 17:45:27 +0000 (Sat, 25 Apr 2009)
Log Message:
-----------
replace ceilf by macro
Modified Paths:
--------------
trunk/NSGeometry_SKExtensions.h
trunk/NSGeometry_SKExtensions.m
trunk/PDFPage_SKExtensions.m
trunk/SKLineWell.m
trunk/SKMainWindowController_Actions.m
trunk/SKNavigationWindow.m
trunk/SKNoteOutlineView.m
trunk/SKPDFToolTipWindow.m
trunk/SKPDFView.m
trunk/SKSecondaryPDFView.m
trunk/SKSnapshotWindowController.m
Modified: trunk/NSGeometry_SKExtensions.h
===================================================================
--- trunk/NSGeometry_SKExtensions.h 2009-04-25 11:16:42 UTC (rev 5327)
+++ trunk/NSGeometry_SKExtensions.h 2009-04-25 17:45:27 UTC (rev 5328)
@@ -88,8 +88,8 @@
NSRect rect;
rect.origin.x = SKFloor(SKMin(aPoint.x, bPoint.x));
rect.origin.y = SKFloor(SKMin(aPoint.y, bPoint.y));
- rect.size.width = ceilf(SKMax(aPoint.x, bPoint.x) - NSMinX(rect));
- rect.size.height = ceilf(SKMax(aPoint.y, bPoint.y) - NSMinY(rect));
+ rect.size.width = SKCeil(SKMax(aPoint.x, bPoint.x) - NSMinX(rect));
+ rect.size.height = SKCeil(SKMax(aPoint.y, bPoint.y) - NSMinY(rect));
return rect;
}
Modified: trunk/NSGeometry_SKExtensions.m
===================================================================
--- trunk/NSGeometry_SKExtensions.m 2009-04-25 11:16:42 UTC (rev 5327)
+++ trunk/NSGeometry_SKExtensions.m 2009-04-25 17:45:27 UTC (rev 5328)
@@ -82,14 +82,14 @@
NSRect SKCenterRect(NSRect rect, NSSize size, BOOL flipped) {
rect.origin.x += 0.5 * (NSWidth(rect) - size.width);
rect.origin.y += 0.5 * (NSHeight(rect) - size.height);
- rect.origin.y = flipped ? ceilf(rect.origin.y) : SKFloor(rect.origin.y);
+ rect.origin.y = flipped ? SKCeil(rect.origin.y) : SKFloor(rect.origin.y);
rect.size = size;
return rect;
}
NSRect SKCenterRectVertically(NSRect rect, CGFloat height, BOOL flipped) {
rect.origin.y += 0.5 * (NSHeight(rect) - height);
- rect.origin.y = flipped ? ceilf(rect.origin.y) : SKFloor(rect.origin.y);
+ rect.origin.y = flipped ? SKCeil(rect.origin.y) : SKFloor(rect.origin.y);
rect.size.height = height;
return rect;
}
Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m 2009-04-25 11:16:42 UTC (rev 5327)
+++ trunk/PDFPage_SKExtensions.m 2009-04-25 17:45:27 UTC (rev 5328)
@@ -140,7 +140,7 @@
rect = bounds;
} else if (NSEqualRects(NSZeroRect, rect)) {
rect.origin.x = SKFloor(NSMidX(bounds));
- rect.origin.x = ceilf(NSMidY(bounds));
+ rect.origin.x = SKCeil(NSMidY(bounds));
} else {
rect.origin.x += NSMinX(bounds);
rect.origin.y += NSMinY(bounds);
@@ -164,7 +164,7 @@
- (NSImage *)thumbnailWithSize:(CGFloat)size forBox:(PDFDisplayBox)box
readingBarRect:(NSRect)readingBarRect {
CGFloat shadowBlurRadius = SKRound(size / 32.0);
- CGFloat shadowOffset = - ceilf(shadowBlurRadius * 0.75);
+ CGFloat shadowOffset = - SKCeil(shadowBlurRadius * 0.75);
return [self thumbnailWithSize:size forBox:box
shadowBlurRadius:shadowBlurRadius shadowOffset:NSMakeSize(0.0, shadowOffset)
readingBarRect:readingBarRect];
}
Modified: trunk/SKLineWell.m
===================================================================
--- trunk/SKLineWell.m 2009-04-25 11:16:42 UTC (rev 5327)
+++ trunk/SKLineWell.m 2009-04-25 17:45:27 UTC (rev 5328)
@@ -158,8 +158,8 @@
if ([self displayStyle] == SKLineWellDisplayStyleLine) {
CGFloat offset = 0.5 * lineWidth - SKFloor(0.5 * lineWidth);
- NSPoint startPoint = NSMakePoint(NSMinX(bounds) + ceilf(0.5 *
NSHeight(bounds)), SKRound(NSMidY(bounds)) - offset);
- NSPoint endPoint = NSMakePoint(NSMaxX(bounds) - ceilf(0.5 *
NSHeight(bounds)), SKRound(NSMidY(bounds)) - offset);
+ NSPoint startPoint = NSMakePoint(NSMinX(bounds) + SKCeil(0.5 *
NSHeight(bounds)), SKRound(NSMidY(bounds)) - offset);
+ NSPoint endPoint = NSMakePoint(NSMaxX(bounds) - SKCeil(0.5 *
NSHeight(bounds)), SKRound(NSMidY(bounds)) - offset);
switch (startLineStyle) {
case kPDFLineStyleNone:
@@ -223,8 +223,8 @@
}
} else if ([self displayStyle] == SKLineWellDisplayStyleSimpleLine) {
CGFloat offset = 0.5 * lineWidth - SKFloor(0.5 * lineWidth);
- [path moveToPoint:NSMakePoint(NSMinX(bounds) + ceilf(0.5 *
NSHeight(bounds)), SKRound(NSMidY(bounds)) - offset)];
- [path lineToPoint:NSMakePoint(NSMaxX(bounds) - ceilf(0.5 *
NSHeight(bounds)), SKRound(NSMidY(bounds)) - offset)];
+ [path moveToPoint:NSMakePoint(NSMinX(bounds) + SKCeil(0.5 *
NSHeight(bounds)), SKRound(NSMidY(bounds)) - offset)];
+ [path lineToPoint:NSMakePoint(NSMaxX(bounds) - SKCeil(0.5 *
NSHeight(bounds)), SKRound(NSMidY(bounds)) - offset)];
} else if ([self displayStyle] == SKLineWellDisplayStyleRectangle) {
CGFloat inset = 7.0 + 0.5 * lineWidth;
[path appendBezierPathWithRect:NSInsetRect(bounds, inset, inset)];
Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m 2009-04-25 11:16:42 UTC (rev
5327)
+++ trunk/SKMainWindowController_Actions.m 2009-04-25 17:45:27 UTC (rev
5328)
@@ -866,8 +866,8 @@
size.height /= scaleFactor;
// Calculate the new size for the window
- size.width = ceilf(NSWidth(frame) + size.width - oldSize.width);
- size.height = ceilf(NSHeight(frame) + size.height - oldSize.height);
+ size.width = SKCeil(NSWidth(frame) + size.width - oldSize.width);
+ size.height = SKCeil(NSHeight(frame) + size.height - oldSize.height);
// Align the window frame from the old topleft point and constrain to the
screen
frame.origin.y = NSMaxY(frame) - size.height;
frame.size = size;
Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m 2009-04-25 11:16:42 UTC (rev 5327)
+++ trunk/SKNavigationWindow.m 2009-04-25 17:45:27 UTC (rev 5328)
@@ -221,7 +221,7 @@
NSRect newFrame = [self frameRectForContentRect:[toolTipView frame]];
NSRect viewRect = [view convertRect:[view bounds] toView:nil];
viewRect.origin = [[view window] convertBaseToScreen:viewRect.origin];
- newFrame.origin = NSMakePoint(ceilf(NSMidX(viewRect) - 0.5 *
NSWidth(newFrame)), NSMaxY(viewRect) + LABEL_OFFSET);
+ newFrame.origin = NSMakePoint(SKCeil(NSMidX(viewRect) - 0.5 *
NSWidth(newFrame)), NSMaxY(viewRect) + LABEL_OFFSET);
[self setFrame:newFrame display:YES];
[self setLevel:[[view window] level]];
if ([self parentWindow] != [view window])
@@ -293,7 +293,7 @@
- (void)sizeToFit {
NSSize size = [[self attributedStringValue] size];
- size.width = ceilf(size.width + 2 * LABEL_TEXT_MARGIN);
+ size.width = SKCeil(size.width + 2 * LABEL_TEXT_MARGIN);
size.height += 2 * LABEL_TEXT_MARGIN;
[self setFrameSize:size];
}
Modified: trunk/SKNoteOutlineView.m
===================================================================
--- trunk/SKNoteOutlineView.m 2009-04-25 11:16:42 UTC (rev 5327)
+++ trunk/SKNoteOutlineView.m 2009-04-25 17:45:27 UTC (rev 5328)
@@ -150,7 +150,7 @@
BOOL isHighlighted = isFirstResponder && [self isRowSelected:row];
NSColor *color = [NSColor colorWithCalibratedWhite:isHighlighted ?
1.0 : 0.5 alpha:0.7];
NSRect rect = [self rectOfRow:row];
- CGFloat x = ceilf(NSMidX(rect));
+ CGFloat x = SKCeil(NSMidX(rect));
CGFloat y = NSMaxY(rect) - 1.5;
[color set];
Modified: trunk/SKPDFToolTipWindow.m
===================================================================
--- trunk/SKPDFToolTipWindow.m 2009-04-25 11:16:42 UTC (rev 5327)
+++ trunk/SKPDFToolTipWindow.m 2009-04-25 17:45:27 UTC (rev 5328)
@@ -233,7 +233,7 @@
if ([selection string]) {
NSRect selBounds = [transform transformRect:[selection
boundsForPage:page]];
- CGFloat top = ceilf(SKMax(NSMaxY(selBounds), NSMinX(selBounds)
+ NSHeight(sourceRect)));
+ CGFloat top = SKCeil(SKMax(NSMaxY(selBounds),
NSMinX(selBounds) + NSHeight(sourceRect)));
CGFloat left = SKFloor(SKMin(NSMinX(selBounds), NSMaxX(bounds)
- NSWidth(sourceRect)));
if (top < NSMaxY(sourceRect))
sourceRect.origin.y = top - NSHeight(sourceRect);
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2009-04-25 11:16:42 UTC (rev 5327)
+++ trunk/SKPDFView.m 2009-04-25 17:45:27 UTC (rev 5328)
@@ -456,8 +456,8 @@
- (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page {
NSRect aRect = [self convertRect:rect fromPage:page];
CGFloat scale = [self scaleFactor];
- CGFloat maxX = ceilf(NSMaxX(aRect) + scale);
- CGFloat maxY = ceilf(NSMaxY(aRect) + scale);
+ CGFloat maxX = SKCeil(NSMaxX(aRect) + scale);
+ CGFloat maxY = SKCeil(NSMaxY(aRect) + scale);
CGFloat minX = SKFloor(NSMinX(aRect) - scale);
CGFloat minY = SKFloor(NSMinY(aRect) - scale);
Modified: trunk/SKSecondaryPDFView.m
===================================================================
--- trunk/SKSecondaryPDFView.m 2009-04-25 11:16:42 UTC (rev 5327)
+++ trunk/SKSecondaryPDFView.m 2009-04-25 17:45:27 UTC (rev 5328)
@@ -147,8 +147,8 @@
- (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page {
NSRect aRect = [self convertRect:rect fromPage:page];
CGFloat scale = [self scaleFactor];
- CGFloat maxX = ceilf(NSMaxX(aRect) + scale);
- CGFloat maxY = ceilf(NSMaxY(aRect) + scale);
+ CGFloat maxX = SKCeil(NSMaxX(aRect) + scale);
+ CGFloat maxY = SKCeil(NSMaxY(aRect) + scale);
CGFloat minX = SKFloor(NSMinX(aRect) - scale);
CGFloat minY = SKFloor(NSMinY(aRect) - scale);
Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m 2009-04-25 11:16:42 UTC (rev 5327)
+++ trunk/SKSnapshotWindowController.m 2009-04-25 17:45:27 UTC (rev 5328)
@@ -112,8 +112,8 @@
- (void)setNeedsDisplayInRect:(NSRect)rect ofPage:(PDFPage *)page {
NSRect aRect = [pdfView convertRect:rect fromPage:page];
CGFloat scale = [pdfView scaleFactor];
- CGFloat maxX = ceilf(NSMaxX(aRect) + scale);
- CGFloat maxY = ceilf(NSMaxY(aRect) + scale);
+ CGFloat maxX = SKCeil(NSMaxX(aRect) + scale);
+ CGFloat maxY = SKCeil(NSMaxY(aRect) + scale);
CGFloat minX = SKFloor(NSMinX(aRect) - scale);
CGFloat minY = SKFloor(NSMinY(aRect) - scale);
@@ -403,7 +403,7 @@
- (NSImage *)thumbnailWithSize:(CGFloat)size {
CGFloat shadowBlurRadius = SKRound(size / 32.0);
- CGFloat shadowOffset = - ceilf(shadowBlurRadius * 0.75);
+ CGFloat shadowOffset = - SKCeil(shadowBlurRadius * 0.75);
return [self thumbnailWithSize:size shadowBlurRadius:shadowBlurRadius
shadowOffset:NSMakeSize(0.0, shadowOffset)];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit