mirror of
https://github.com/exyte/Macaw.git
synced 2024-09-11 05:05:23 +03:00
Fix for mac os version building
This commit is contained in:
parent
ac8e533e30
commit
72fe01040a
@ -84,7 +84,7 @@ open class Shape: Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fileprivate func createContext() -> CGContext? {
|
fileprivate func createContext() -> CGContext? {
|
||||||
let screenScale: CGFloat = MMainScreen()?.scale ?? 1.0
|
let screenScale: CGFloat = MMainScreen()?.mScale ?? 1.0
|
||||||
let smallSize = CGSize(width: 1.0, height: 1.0)
|
let smallSize = CGSize(width: 1.0, height: 1.0)
|
||||||
|
|
||||||
MGraphicsBeginImageContextWithOptions(smallSize, false, screenScale)
|
MGraphicsBeginImageContextWithOptions(smallSize, false, screenScale)
|
||||||
|
@ -69,7 +69,7 @@ class GroupRenderer: NodeRenderer {
|
|||||||
renderers.removeAll()
|
renderers.removeAll()
|
||||||
|
|
||||||
renderers = group.contents.compactMap { child -> NodeRenderer? in
|
renderers = group.contents.compactMap { child -> NodeRenderer? in
|
||||||
return RenderUtils.createNodeRenderer(child, view: view, parentRenderer: self)
|
RenderUtils.createNodeRenderer(child, view: view, parentRenderer: self)
|
||||||
}
|
}
|
||||||
|
|
||||||
var parent: NodeRenderer = self
|
var parent: NodeRenderer = self
|
||||||
|
@ -254,7 +254,7 @@ class NodeRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func renderToImage(bounds: Rect, inset: Double = 0, coloringMode: ColoringMode = .rgb) -> MImage {
|
func renderToImage(bounds: Rect, inset: Double = 0, coloringMode: ColoringMode = .rgb) -> MImage {
|
||||||
let screenScale: CGFloat = MMainScreen()?.scale ?? 1.0
|
let screenScale: CGFloat = MMainScreen()?.mScale ?? 1.0
|
||||||
MGraphicsBeginImageContextWithOptions(CGSize(width: bounds.w + inset, height: bounds.h + inset), false, screenScale)
|
MGraphicsBeginImageContextWithOptions(CGSize(width: bounds.w + inset, height: bounds.h + inset), false, screenScale)
|
||||||
let tempContext = MGraphicsGetCurrentContext()!
|
let tempContext = MGraphicsGetCurrentContext()!
|
||||||
|
|
||||||
|
@ -101,12 +101,12 @@ open class MacawView: MView, MGestureRecognizerDelegate {
|
|||||||
#if os(OSX)
|
#if os(OSX)
|
||||||
open override var layer: CALayer? {
|
open override var layer: CALayer? {
|
||||||
didSet {
|
didSet {
|
||||||
guard self.layer != nil else {
|
guard self.layer != nil else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
initializeView()
|
initializeView()
|
||||||
|
|
||||||
self.renderer = RenderUtils.createNodeRenderer(node, view: self)
|
self.renderer = RenderUtils.createNodeRenderer(node, view: self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user