diff --git a/Source/utils/CGMappings.swift b/Source/utils/CGMappings.swift index 92a89c6d..d2f247f7 100644 --- a/Source/utils/CGMappings.swift +++ b/Source/utils/CGMappings.swift @@ -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())