Unverified Commit a29209ba authored by Eric Shelbogashev's avatar Eric Shelbogashev Committed by GitHub

Fixed Macos multiplatform sample (#1090)

Fixed 
- Unresolved reference 'layer' in MacosClocks constructor
- Added startup trigger `skiaLayer.needRedraw()` in main()
parent 496703f8
......@@ -50,5 +50,6 @@ fun main() {
val clocks = MacosClocks(skiaLayer, window)
skiaLayer.renderDelegate = SkiaLayerRenderDelegate(skiaLayer, clocks)
window.makeKeyAndOrderFront(app)
skiaLayer.needRedraw()
app.run()
}
......@@ -11,7 +11,7 @@ import platform.AppKit.NSViewHeightSizable
import platform.AppKit.NSViewWidthSizable
import platform.AppKit.NSWindow
class MacosClocks(skiaLayer: SkiaLayer, window: NSWindow) : Clocks(layer::renderApi) {
class MacosClocks(layer: SkiaLayer, window: NSWindow) : Clocks(layer::renderApi) {
init {
val nsView = object : NSView(window.frame) {
private var trackingArea : NSTrackingArea? = null
......@@ -39,6 +39,6 @@ class MacosClocks(skiaLayer: SkiaLayer, window: NSWindow) : Clocks(layer::render
val contentView = window.contentView!!
nsView.autoresizingMask = NSViewHeightSizable or NSViewWidthSizable
contentView.addSubview(nsView)
skiaLayer.attachTo(nsView)
layer.attachTo(nsView)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment