mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 20:14:05 +09:00
fix: clickOnceListener would not fired if screen is magnified
This commit is contained in:
@@ -190,7 +190,7 @@ abstract class UICanvas(
|
||||
if (!uiItems.contains(uiItem)) uiItems.add(uiItem)
|
||||
}
|
||||
|
||||
fun mouseInScreen(x: Int, y: Int) = x in 0 until App.scr.width && y in 0 until App.scr.height
|
||||
fun mouseInScreen(x: Int, y: Int) = x in 0 until App.scr.windowW && y in 0 until App.scr.windowH
|
||||
|
||||
/**
|
||||
* Called by the screen's InputProcessor
|
||||
|
||||
@@ -215,6 +215,8 @@ abstract class UIItem(var parentUI: UICanvas, val initialX: Int, val initialY: I
|
||||
return false
|
||||
}
|
||||
open fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
|
||||
// FIXME does not work with magnified screen
|
||||
|
||||
var actionDone = false
|
||||
|
||||
if (parentUI.isVisible && isActive) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.Texture
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.CommonResourcePool
|
||||
import net.torvald.terrarum.blendNormalStraightAlpha
|
||||
import net.torvald.terrarum.toInt
|
||||
|
||||
Reference in New Issue
Block a user