mirror of
https://github.com/exyte/Macaw.git
synced 2024-10-05 16:57:12 +03:00
Fix native image scale
This commit is contained in:
parent
197903c131
commit
96e4900855
@ -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())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user