Skip to content

Commit

Permalink
Twist logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rexrainbow committed Sep 30, 2024
1 parent 9b083b0 commit 5e4e101
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/ui/utils/setchildreninteractive/ContainsPoint.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ContainsPointTest from '../ContainsPoint.js';

var ContainsPoint = function (gameObjects, x, y, targetMode) {
var ContainsPoint = function (targetMode, gameObjects, x, y) {
if (targetMode === 'parent') {
var parent;
for (var i = 0, cnt = gameObjects.length; i < cnt; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var EmitChildEvent = function (eventEmitter, eventName, targets, targetMode, wor
var camera = pointer.camera;
var px = worldX + camera.scrollX * (firstChild.scrollFactorX - 1);
var py = worldY + camera.scrollY * (firstChild.scrollFactorY - 1);
child = ContainsPoint(targets, px, py, targetMode);
child = ContainsPoint(targetMode, targets, px, py);
}

if (!child) {
Expand Down
2 changes: 1 addition & 1 deletion templates/ui/utils/setchildreninteractive/OverChild.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var OnMove = function (pointer, localX, localY, event) {
var px = pointer.worldX + camera.scrollX * (firstChild.scrollFactorX - 1);
var py = pointer.worldY + camera.scrollY * (firstChild.scrollFactorY - 1);

var child = ContainsPoint(childrenInteractive.targetSizers, px, py, childrenInteractive.targetMode);
var child = ContainsPoint(childrenInteractive.targetMode, childrenInteractive.targetSizers, px, py);
var preChild = childrenInteractive.lastOverChild;
if (child && preChild &&
(child === preChild)) {
Expand Down

0 comments on commit 5e4e101

Please sign in to comment.