Skip to content

Commit

Permalink
Fix native image scale
Browse files Browse the repository at this point in the history
  • Loading branch information
hotbott committed Dec 2, 2021
1 parent 197903c commit 96e4900
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/utils/CGMappings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit 96e4900

Please sign in to comment.