Skip to content

Commit 1dbf78b

Browse files
authored
Merge pull request gustavostuff#18 from DaemonLee/master
Fixed dialog when using non-1 scaling.
2 parents 39c33fc + 424b7bc commit 1dbf78b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

gooi/gooi.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,7 @@ end
16001600

16011601
--*********************************************
16021602
--*********************************************
1603-
-- Special dialog widgets:
1603+
-- Special dialog widgets:
16041604
--*********************************************
16051605
--*********************************************
16061606

@@ -1627,7 +1627,7 @@ function gooi.dialog(params, kind)
16271627
positiveBtnTxt = params.okText or positiveBtnTxt
16281628
negativeBtnTxt = params.cancelText or negativeBtnTxt
16291629

1630-
local w, h = love.graphics.getWidth(), love.graphics.getHeight()
1630+
local w, h = love.graphics.getWidth() / gooi.sx, love.graphics.getHeight() / gooi.sy
16311631

16321632
local smaller = gooi.smallerSide()
16331633

@@ -1640,10 +1640,10 @@ function gooi.dialog(params, kind)
16401640
end
16411641

16421642
gooi.panelDialog = gooi.newPanel({
1643-
x = math.floor(w / 2 - gooi.dialogW / 2),
1644-
y = math.floor(h / 2 - gooi.dialogH / 2),
1645-
w = math.floor(gooi.dialogW),
1646-
h = math.floor(gooi.dialogH),
1643+
x = math.floor(w / 2 - gooi.dialogW / 2 / gooi.sx),
1644+
y = math.floor(h / 2 - gooi.dialogH / 2 / gooi.sy),
1645+
w = math.floor(gooi.dialogW / gooi.sx),
1646+
h = math.floor(gooi.dialogH / gooi.sy),
16471647
layout = "grid 3x3"}
16481648
)
16491649

0 commit comments

Comments
 (0)