-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Component is sometimes not correctly rendered #268
Comments
This issue seems only occuring on Ubuntu (and other Linux distros ?) but not on Windows 10. |
so I have found a workaround. But it is not nice. But maybe it could be evolved into a real one. class SwingCanvasRenderer(private val canvas: Canvas,
private val frame: JFrame,
private val tileGrid: InternalTileGrid,
private val config: AppConfig) : Renderer {
private var firstDraw = true
private val tilesetLoader = SwingTilesetLoader()
private var blinkOn = true
private var lastRender: Long = SystemUtils.getCurrentTimeMs()
private var lastBlink: Long = lastRender
private val keyboardEventListener = KeyboardEventListener()
private val mouseEventListener = object : MouseEventListener(
fontWidth = tileGrid.tileset.width,
fontHeight = tileGrid.tileset.height) {
override fun mouseClicked(e: MouseEvent) {
super.mouseClicked(e)
canvas.requestFocusInWindow()
}
}
override fun create() {
if (config.fullScreen) {
frame.extendedState = JFrame.MAXIMIZED_BOTH
frame.isUndecorated = true
} else {
frame.setSize(tileGrid.widthInPixels, tileGrid.heightInPixels)
}
frame.isVisible = true
frame.isResizable = true the last line...I had the suspicion that the swing frame tries to readjust during create and it could not since the resiable is false. With true it seems to work, although now the user could resize the window But maybe later it could be reset to false, do not know. |
Seems like a Linux issue, right? |
yes, Ubuntu |
sorry, I have no running ubuntu anymore...so I cannot confirm the status of this issue |
Me neither. 😞 This issue might go away if we implement resizeable components though. Alternatively we can say that resizeable is |
A component is sometimes not correctly rendered
Expected behavior
The component shall be aligned correctly regarding the alignment
Actual behavior
Sometimes the component is cut at the edge of the screen if using the current master of Zircon
Steps to reproduce the bug
Restart the following app a couple of times to reproduce the issue
The text was updated successfully, but these errors were encountered: