1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-12-25 06:43:24 +03:00

Make use of automatic conversion between CGFloat and Double

This commit is contained in:
Tae Won Ha 2021-12-23 19:48:57 +01:00
parent b671e0d60b
commit 63f7d65084
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
7 changed files with 17 additions and 17 deletions

View File

@ -49,7 +49,7 @@ public class NvimView: NSView,
public internal(set) var theme = Theme.default public internal(set) var theme = Theme.default
public var trackpadScrollResistance = 5.cgf public var trackpadScrollResistance = 5.0
public var usesLiveResize = false public var usesLiveResize = false
@ -251,7 +251,7 @@ public class NvimView: NSView,
let ugrid = UGrid() let ugrid = UGrid()
let cellAttributesCollection = CellAttributesCollection() let cellAttributesCollection = CellAttributesCollection()
let drawer: AttributesRunDrawer let drawer: AttributesRunDrawer
var baselineOffset = 0.cgf var baselineOffset = 0.0
/// We store the last marked text because Cocoa's text input system does the following: /// We store the last marked text because Cocoa's text input system does the following:
/// -> hanja popup -> insertText() -> attributedSubstring...() -> setMarkedText() -> ... /// -> hanja popup -> insertText() -> attributedSubstring...() -> setMarkedText() -> ...
@ -269,7 +269,7 @@ public class NvimView: NSView,
var scrollGuardCounterY = 5 var scrollGuardCounterY = 5
var isCurrentlyPinching = false var isCurrentlyPinching = false
var pinchTargetScale = 1.cgf var pinchTargetScale = 1.0
var pinchBitmap: NSBitmapImageRep? var pinchBitmap: NSBitmapImageRep?
var currentlyResizing = false var currentlyResizing = false

View File

@ -38,8 +38,8 @@ final class Typesetter {
CTRunGetStringIndices(run, .zero, &indices) CTRunGetStringIndices(run, .zero, &indices)
var column = -1 var column = -1
var columnPosition = 0.cgf var columnPosition = 0.0
var deltaX = 0.cgf var deltaX = 0.0
positions.withUnsafeMutableBufferPointer { positionsPtr -> Void in positions.withUnsafeMutableBufferPointer { positionsPtr -> Void in
for i in 0..<positionsPtr.count { for i in 0..<positionsPtr.count {

View File

@ -185,7 +185,7 @@ extension BuffersList {
} }
self.bufferList.tableColumns[0].width = max( self.bufferList.tableColumns[0].width = max(
self.bufferList.tableColumns[0].width, cellWidth + 10.cgf self.bufferList.tableColumns[0].width, cellWidth + 10.0
) )
} }

View File

@ -173,7 +173,7 @@ class FileOutlineView: NSOutlineView,
private let treeController = NSTreeController() private let treeController = NSTreeController()
private let fileMonitor = FileMonitor() private let fileMonitor = FileMonitor()
private var cachedColumnWidth = 20.cgf private var cachedColumnWidth = 20.0
private var usesTheme: Bool private var usesTheme: Bool
private var lastFileSystemUpdateMark = Token() private var lastFileSystemUpdateMark = Token()
private var showsFileIcon: Bool private var showsFileIcon: Bool
@ -524,5 +524,5 @@ private extension NSTreeNode {
var node: Node? { self.representedObject as? Node } var node: Node? { self.representedObject as? Node }
} }
private let columnWidthRightPadding = 40.cgf private let columnWidthRightPadding = 40.0
private let triangleImageSize = 18.cgf private let triangleImageSize = 18.0

View File

@ -463,7 +463,7 @@ struct WorkspaceToolState: Codable {
} }
var location = WorkspaceBarLocation.left var location = WorkspaceBarLocation.left
var dimension = 200.cgf var dimension = 200.0
var open = false var open = false
init(from decoder: Decoder) throws { init(from decoder: Decoder) throws {

View File

@ -21,8 +21,8 @@ open class CustomToolBar: NSView {
public class InnerToolBar: NSView, NSUserInterfaceValidations { public class InnerToolBar: NSView, NSUserInterfaceValidations {
// MARK: - Public // MARK: - Public
public static let iconDimension = 16.cgf public static let iconDimension = 16.0
public static let itemPadding = 4.cgf public static let itemPadding = 4.0
public static func configureToStandardIconButton( public static func configureToStandardIconButton(
button: NSButton, button: NSButton,
@ -114,7 +114,7 @@ public class InnerToolBar: NSView, NSUserInterfaceValidations {
} }
} }
private static let separatorThickness = 1.cgf private static let separatorThickness = 1.0
private static let height = InnerToolBar.iconDimension + 2 + 2 + InnerToolBar.separatorThickness private static let height = InnerToolBar.iconDimension + 2 + 2 + InnerToolBar.separatorThickness
private let titleField = NSTextField(forAutoLayout: ()) private let titleField = NSTextField(forAutoLayout: ())

View File

@ -46,14 +46,14 @@ private class ProxyBar: NSView {
} }
class WorkspaceBar: NSView, WorkspaceToolDelegate { class WorkspaceBar: NSView, WorkspaceToolDelegate {
private static let separatorThickness = 1.cgf private static let separatorThickness = 1.0
fileprivate(set) var tools = [WorkspaceTool]() fileprivate(set) var tools = [WorkspaceTool]()
private weak var selectedTool: WorkspaceTool? private weak var selectedTool: WorkspaceTool?
private var isMouseDownOngoing = false private var isMouseDownOngoing = false
private var dragIncrement = 1.cgf private var dragIncrement = 1.0
private var layoutConstraints = [NSLayoutConstraint]() private var layoutConstraints = [NSLayoutConstraint]()
@ -66,7 +66,7 @@ class WorkspaceBar: NSView, WorkspaceToolDelegate {
// MARK: - API // MARK: - API
static let minimumDimension = 50.cgf static let minimumDimension = 50.0
let location: WorkspaceBarLocation let location: WorkspaceBarLocation
var isButtonVisible = true { var isButtonVisible = true {
@ -591,7 +591,7 @@ extension WorkspaceBar {
private func resizeRect() -> CGRect { private func resizeRect() -> CGRect {
let separatorRect = self.outerSeparatorRect() let separatorRect = self.outerSeparatorRect()
let clickDimension = 4.cgf let clickDimension = 4.0
switch self.location { switch self.location {
case .top: case .top: