Skip to content

Commit 1729ceb

Browse files
authored
Fix #175: edf elements represented by objects are not double-clickable (#219)
* Fixes elements represented by objects not being double-clickable weird fix but ok * Check if edf:rep is true just in case * Update main.lua
1 parent 2727b76 commit 1729ceb

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

[editor]/editor_main/client/main.lua

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,19 @@ function setRepresentationCollisionsEnabled(element, state)
635635
end
636636
end
637637

638+
function requiresObjectCollisions(element)
639+
for k, child in ipairs(getElementChildren(element)) do
640+
if not getElementData(child, "edf:dummy") then
641+
if getElementData(child, "edf:rep") then
642+
if getElementType(child) ~= "object" then
643+
return false
644+
end
645+
end
646+
end
647+
end
648+
return true
649+
end
650+
638651
-- Drag and drop
639652
function processCursorMove(cursorX, cursorY, absoluteX, absoluteY, worldX, worldY, worldZ)
640653
if g_dragElement then
@@ -758,7 +771,9 @@ function selectElement(element, submode, shortcut, dropreleaseLock, dropclonedro
758771
assert(handle == nil or isElement(handle), "Bad handle ["..tostring(handle).."] for element: "..getElementType(element))
759772

760773
-- temporarily disable collisions for all parts
761-
setRepresentationCollisionsEnabled(element, false)
774+
if not requiresObjectCollisions(element) then
775+
setRepresentationCollisionsEnabled(element, false)
776+
end
762777

763778
-- if we can position this element, grab it and add the markers
764779
if handle then

0 commit comments

Comments
 (0)