mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-25 04:54:07 +00:00
Enhance PatchTree and applyPatch to skip TouchInterest instances during patch processing
- Added logic in PatchTree.build and applyPatch functions to skip instances of ClassName "TouchInterest", which are auto-created by Roblox for touch events. - This change improves the handling of patch applications by preventing unnecessary processing of these instances.
This commit is contained in:
parent
4a09689090
commit
aa09717545
2 changed files with 11 additions and 0 deletions
|
|
@ -335,6 +335,11 @@ function PatchTree.build(patch, instanceMap, changeListHeaders)
|
||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Skip TouchInterest (auto-created by Roblox when touch events are connected)
|
||||||
|
if instance.ClassName == "TouchInterest" then
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
-- Gather ancestors from existing DOM
|
-- Gather ancestors from existing DOM
|
||||||
-- (note that they may have no ID if they're being removed as unknown)
|
-- (note that they may have no ID if they're being removed as unknown)
|
||||||
local ancestryIds = {}
|
local ancestryIds = {}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,12 @@ local function applyPatch(instanceMap, patch)
|
||||||
local deferredRefs = {}
|
local deferredRefs = {}
|
||||||
|
|
||||||
for _, removedIdOrInstance in ipairs(patch.removed) do
|
for _, removedIdOrInstance in ipairs(patch.removed) do
|
||||||
|
-- Skip TouchInterest (auto-created by Roblox when touch events are connected)
|
||||||
|
local instance = if Types.RbxId(removedIdOrInstance) then instanceMap.fromIds[removedIdOrInstance] else removedIdOrInstance
|
||||||
|
if instance and instance.ClassName == "TouchInterest" then
|
||||||
|
continue
|
||||||
|
end
|
||||||
|
|
||||||
local removeInstanceSuccess = pcall(function()
|
local removeInstanceSuccess = pcall(function()
|
||||||
if Types.RbxId(removedIdOrInstance) then
|
if Types.RbxId(removedIdOrInstance) then
|
||||||
instanceMap:destroyId(removedIdOrInstance)
|
instanceMap:destroyId(removedIdOrInstance)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue