- force_try
- leading_whitespace
- vertical_whitespace
- - legacy_constructor
- cyclomatic_complexity
- legacy_nsgeometry_functions
- redundant_optional_initialization
)
let top = context.objectForKeyedSubscript("atop").toDouble()
let left = context.objectForKeyedSubscript("aleft").toDouble()
- flashTopLeft = NSMakePoint(CGFloat(left), webView.frame.size.height - CGFloat(top) - 480)
+ flashTopLeft = NSPoint(x: CGFloat(left), y: webView.frame.size.height - CGFloat(top) - 480)
}
if path.hasSuffix("app_id=854854") {
guard let context = frame.javaScriptContext else { return }
guard validIframe != 0 else { return }
let top = context.objectForKeyedSubscript("atop").toDouble()
let left = context.objectForKeyedSubscript("aleft").toDouble()
- flashTopLeft = NSMakePoint(flashTopLeft.x + CGFloat(left), flashTopLeft.y - CGFloat(top))
+ flashTopLeft = NSPoint(x: flashTopLeft.x + CGFloat(left), y: flashTopLeft.y - CGFloat(top))
adjustFlash()
}
}
static var markImage: NSImage = {
let radius: CGFloat = 10.0
- let image = NSImage(size: NSMakeSize(radius, radius))
+ let image = NSImage(size: NSSize(width: radius, height: radius))
image.lockFocus()
NSColor.red.highlight(withLevel: 0.6)?.set()
- NSBezierPath(roundedRect: NSMakeRect(0, 0, radius, radius),
+ NSBezierPath(roundedRect: NSRect(x: 0, y: 0, width: radius, height: radius),
xRadius: radius / 2,
yRadius: radius / 2)
.fill()
private var imageShadow: NSShadow {
if let s = internalImageShadow { return s }
let s = NSShadow()
- s.shadowOffset = NSMakeSize(2, -2)
+ s.shadowOffset = NSSize(width: 2, height: -2)
s.shadowBlurRadius = 4
s.shadowColor = NSColor.darkGray
internalImageShadow = s
} else {
ratio = ratioX
}
- let fitSize = NSMakeSize(imageSize.width * ratio, imageSize.height * ratio)
+ let fitSize = NSSize(width: imageSize.width * ratio, height: imageSize.height * ratio)
let left = (target.size.width - fitSize.width) * 0.5
let bottom = (target.size.height - fitSize.height) * 0.5
- return NSMakeRect(left, bottom, fitSize.width, fitSize.height)
+ return NSRect(x: left, y: bottom, width: fitSize.width, height: fitSize.height)
}
}
override init?(nibName: String?, bundle: Bundle?) {
trimInfo = [
- TrimRectInformation(name: "Status", rect: NSMakeRect(328, 13, 470, 365)),
- TrimRectInformation(name: "List", rect: NSMakeRect(362, 15, 438, 368)),
- TrimRectInformation(name: "AirplaneBase", rect: NSMakeRect(575, 13, 225, 358))
+ TrimRectInformation(name: "Status", rect: NSRect(x: 328, y: 13, width: 470, height: 365)),
+ TrimRectInformation(name: "List", rect: NSRect(x: 362, y: 15, width: 438, height: 368)),
+ TrimRectInformation(name: "AirplaneBase", rect: NSRect(x: 575, y: 13, width: 225, height: 358))
]
currentTrimInfo = trimInfo[0]
super.init(nibName: "ScreenshotEditorViewController", bundle: nil)
extension ScreenshotListViewController: NSCollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> NSSize {
let f = realFromZoom(zoom: zoom)
- return NSMakeSize(f, f)
+ return NSSize(width: f, height: f)
}
}
let range = layoutManager.glyphRange(for: textContainer)
let glyph = UnsafeMutablePointer<CGGlyph>.allocate(capacity: range.length)
let glyphLength = layoutManager.getGlyphs(in: range, glyphs: glyph, properties: nil, characterIndexes: nil, bidiLevels: nil)
- var point = NSMakePoint(StrokeTextFieldCell.boarderWidth, 0)
+ var point = NSPoint(x: StrokeTextFieldCell.boarderWidth, y: 0)
point.y -= font.descender
if controlView.isFlipped {
point.y -= NSHeight(controlView.frame)
let y: CGFloat = type == .fuel ? height + 2.0 : 1.0
for i in 0...10 {
let x: CGFloat = CGFloat(1 + i) + width * CGFloat(i)
- let cellRect = NSMakeRect(x, y, width, height)
+ let cellRect = NSRect(x: x, y: y, width: width, height: height)
color(of: type, position: i, border: border).set()
NSBezierPath(rect: cellRect).fill()
}