Commit c58b2ea4 authored by Roman Sedaikin's avatar Roman Sedaikin

Fixed multi-window DPI support.

parent 19edb05e
......@@ -36,6 +36,7 @@ fun createWindow(title: String) {
val window = SkiaWindow()
window.defaultCloseOperation = WindowConstants.EXIT_ON_CLOSE
window.title = title
// Create menu.
val menuBar = JMenuBar()
......@@ -73,9 +74,9 @@ fun createWindow(title: String) {
}
})
window.setVisible(true)
// MANDATORY: set window size after calling setVisible(true)
// MANDATORY: set window size before calling setVisible(true)
window.setSize(800, 600)
window.setVisible(true)
}
class Renderer(val displayScene: (Renderer, Int, Int) -> Unit): SkiaRenderer {
......
......@@ -70,7 +70,7 @@ open class SkiaLayer() : HardwareLayer() {
}
private fun initSkija() {
val dpi = contentScale
val dpi = graphicsConfiguration.defaultTransform.scaleX.toFloat()
initRenderTarget(dpi)
initSurface()
scaleCanvas(dpi)
......
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