File tree Expand file tree Collapse file tree
src/main/kotlin/sc/iview/ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ import java.util.*
5252import javax.script.ScriptException
5353import javax.swing.*
5454import kotlin.concurrent.thread
55+ import kotlin.math.log
5556import kotlin.math.roundToInt
5657
5758
@@ -235,6 +236,12 @@ class SwingMainWindow(val sciview: SciView) : MainWindow() {
235236 frame.add(mainSplitPane, BorderLayout .CENTER )
236237 frame.add(toolbar, BorderLayout .EAST )
237238 frame.defaultCloseOperation = JFrame .DO_NOTHING_ON_CLOSE
239+ frame.addComponentListener(object : ComponentAdapter () {
240+ override fun componentResized (e : ComponentEvent ) {
241+ sciview.windowWidth = e.component.width
242+ sciview.windowHeight = e.component.height
243+ }
244+ })
238245 frame.addWindowListener(object : WindowAdapter () {
239246 override fun windowClosing (e : WindowEvent ) {
240247 logger.debug(" Closing SciView window." )
You can’t perform that action at this time.
0 commit comments