updating based on PR feedback

This commit is contained in:
Joe Heck 2024-03-22 11:35:04 -07:00
parent 91ea6f28ee
commit d28b36d15a
4 changed files with 12 additions and 26 deletions

View File

@ -20,6 +20,14 @@ public typealias RSImage = UIImage
public extension RSImage {
#if os(macOS)
static let maxScreenScale = CGFloat(2)
#endif
#if os(iOS)
static let maxScreenScale = CGFloat(3)
#endif
/// Create a colored image from the source image using a specified color.
///
/// - Parameter color: The color with which to fill the mask image.

View File

@ -1,25 +0,0 @@
//
// RSScreen.swift
// RSCore
//
// Created by Maurice Parker on 4/11/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
#if os(macOS)
import AppKit
public class RSScreen {
public static let maxScreenScale = CGFloat(2)
}
#endif
#if os(iOS)
import UIKit
public class RSScreen {
public static let maxScreenScale = CGFloat(3)
}
#endif

View File

@ -13,6 +13,9 @@ import os.log
// asserts that OSLog is a sendable type
// @preconcurrency import os.log _should_ resolve the warning in this scenario, but does
// not due to a bug (in Swift 5.10)
#if swift(>=6.0)
#warning("Reevaluate whether this Sendable decoration is still needed for OSLog.")
#endif
extension OSLog: @unchecked Sendable { }
struct ErrorHandler {

View File

@ -22,7 +22,7 @@ extension RSImage {
}
static func scaledForIcon(_ data: Data) -> RSImage? {
let scaledMaxPixelSize = Int(ceil(CGFloat(RSImage.maxIconSize) * RSScreen.maxScreenScale))
let scaledMaxPixelSize = Int(ceil(CGFloat(RSImage.maxIconSize) * maxScreenScale))
guard var cgImage = RSImage.scaleImage(data, maxPixelSize: scaledMaxPixelSize) else {
return nil
}