mirror of
https://github.com/exyte/Macaw.git
synced 2024-07-14 16:30:34 +03:00
commit
29ec199cbc
@ -8,7 +8,7 @@
|
||||
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Macaw"
|
||||
s.version = "0.9.9"
|
||||
s.version = "0.9.10"
|
||||
s.summary = "Powerful and easy-to-use vector graphics library with SVG support written in Swift."
|
||||
|
||||
s.homepage = 'https://github.com/exyte/Macaw.git'
|
||||
|
@ -135,11 +135,11 @@ public extension CGAffineTransform {
|
||||
|
||||
public extension Node {
|
||||
|
||||
func toNativeImage(size: Size, layout: ContentLayout = .of()) throws -> MImage {
|
||||
func toNativeImage(size: Size, layout: ContentLayout = .of(), scale: CGFloat = 0.0) throws -> MImage {
|
||||
let renderer = RenderUtils.createNodeRenderer(self, view: nil)
|
||||
let rect = size.rect()
|
||||
|
||||
MGraphicsBeginImageContextWithOptions(size.toCG(), false, 1)
|
||||
MGraphicsBeginImageContextWithOptions(size.toCG(), false, scale)
|
||||
let ctx = MGraphicsGetCurrentContext()!
|
||||
ctx.clear(rect.toCG())
|
||||
|
||||
@ -149,6 +149,7 @@ public extension Node {
|
||||
|
||||
defer {
|
||||
MGraphicsEndImageContext()
|
||||
renderer.dispose()
|
||||
}
|
||||
|
||||
guard let img = MGraphicsGetImageFromCurrentImageContext() else {
|
||||
|
Loading…
Reference in New Issue
Block a user