Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Modules/Sources/WordPressUI/Extensions/UIImage+Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ public extension UIImage {

/// Create an image of the given `size` that's made of a single `color`.
///
/// Size is in points.
/// - parameter size: Size in points.
convenience init(color: UIColor, size: CGSize = CGSize(width: 1.0, height: 1.0)) {
let image = UIGraphicsImageRenderer(size: size).image { rendererContext in
let image = UIGraphicsImageRenderer(size: size).image { context in
color.setFill()
rendererContext.fill(CGRect(origin: .zero, size: size))
context.fill(CGRect(origin: .zero, size: size))
}
if let cgImage = image.cgImage {
self.init(cgImage: cgImage, scale: image.scale, orientation: .up)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, it was using scale 1.

} else {
assertionFailure("faield to render image with color")
self.init()
}

self.init(cgImage: image.cgImage!) // Force because there's no reason that the `cgImage` should be nil
}
}
1 change: 1 addition & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [*] Fix dynamic type support in the compliance popover [#23932]
* [*] Improve transisions and interactive dismiss gestures for sheets [#23933]
* [*] Add "Share" action to site link context menu on dashboard [#23935]
* [*] Fix layout issues in Privacy Settings section of App Settings [#23936]

25.6
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class PrivacySettingsViewController: UITableViewController {
PaddedInfoRow.self,
SwitchRow.self,
PaddedLinkRow.self
], tableView: self.tableView)
], tableView: self.tableView)

handler = ImmuTableViewHandler(takeOver: self)
reloadViewModel()
Expand Down