Open vBoykoGit opened 3 years ago
Hello, can you add a scale?
func toNativeImage(size: Size, _ scale: CGFloat = UIScreen.main.scale, layout: ContentLayout = .of()) -> MImage { let renderer = RenderUtils.createNodeRenderer(self, view: nil) let rect = size.rect() MGraphicsBeginImageContextWithOptions(size.toCG(), false, scale) let ctx = MGraphicsGetCurrentContext()! ctx.clear(rect.toCG()) let transform = LayoutHelper.calcTransform(self, layout, size) ctx.concatenate(transform.toCG()) renderer.render(in: ctx, force: false, opacity: self.opacity) let img = MGraphicsGetImageFromCurrentImageContext() MGraphicsEndImageContext() return img! }
Hello, can you add a scale?