resize the image

This commit is contained in:
Peter Tang
2023-09-30 15:03:16 +08:00
parent 1cf614036f
commit 703f252765
4 changed files with 152 additions and 1 deletions

View File

@@ -75,7 +75,7 @@ extension MathImage {
intrinsicContentSize = intrinsicContentSize(displayList)
displayList.textColor = textColor
let size = intrinsicContentSize
let size = intrinsicContentSize.integral
layoutImage(size: size, displayList: displayList)
#if os(iOS)
@@ -107,3 +107,12 @@ private extension CGAffineTransform {
return transform
}
}
extension CGSize: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(width)
hasher.combine(height)
}
var integral: CGSize {
CGSize(width: ceil(width), height: ceil(height))
}
}