This repository has been archived by the owner on Feb 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from teambition/fix/miniMap-orientation
fix incorrect image orientation in miniMap
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// UIImage+Resize.swift | ||
// PhotoBrowser | ||
// | ||
// Created by WangWei on 2019/6/18. | ||
// Copyright © 2019 Teambition. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIImage { | ||
func resize(to size: CGSize) -> UIImage { | ||
UIGraphicsBeginImageContextWithOptions(size, false, 0) | ||
let context = UIGraphicsGetCurrentContext() | ||
draw(in: CGRect(origin: .zero, size: size)) | ||
guard let cgImage = context?.makeImage() else { | ||
return self | ||
} | ||
return UIImage(cgImage: cgImage) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters