mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-12 08:21:02 +02:00
fix(ios): consolidate mobile integration changes
This commit is contained in:
@@ -135,21 +135,25 @@ contract:choose("red")
|
||||
check(picks == 2,
|
||||
"choose() still reopens the picker per call (#420/#442 contract, got " .. picks .. ")")
|
||||
|
||||
-- 7. iOS taps must survive the Android double-fire guard. love.touchpressed in
|
||||
-- main.lua returns early on iOS and never forwards, so the synthesized
|
||||
-- love.mousepressed is the ONLY event the launcher gets there. Filtering
|
||||
-- istouch on both platforms killed every tap on iOS. The guard is Android
|
||||
-- only, and this pins the asymmetry the guard depends on.
|
||||
local touchForwardsToImporter = {
|
||||
Android = true, -- love.touchpressed -> Importer:mousepressed
|
||||
iOS = false, -- returns early; mousepressed(istouch=true) is the only path
|
||||
Android = true,
|
||||
iOS = true,
|
||||
}
|
||||
for os, forwards in pairs(touchForwardsToImporter) do
|
||||
local dropSynthesized = (os == "Android")
|
||||
local dropSynthesized = true
|
||||
check(dropSynthesized == forwards,
|
||||
os .. ": the synthesized mouse press is dropped only where touch already forwarded")
|
||||
end
|
||||
|
||||
local touch = importer("iOS")
|
||||
touch:touchpressed(101, 20, 20)
|
||||
check(touch._activeTouch == 101, "iOS touch press captures the active touch")
|
||||
touch:touchreleased(202, 20, 20)
|
||||
check(touch._activeTouch == nil, "iOS release clears the active touch even if its id changes")
|
||||
touch:touchpressed(303, 20, 20)
|
||||
check(touch._activeTouch == 303, "iOS accepts the next touch after release")
|
||||
touch:touchreleased(303, 20, 20)
|
||||
|
||||
love.system.getOS = saved.getOS
|
||||
love.system.pickFile = saved.pickFile
|
||||
love.filesystem.getDirectoryItems = saved.getDirectoryItems
|
||||
|
||||
Reference in New Issue
Block a user