Problem Description
The container isn't checked when using the Set position to object action.
The problem is expected because in acts.SetPosToObject in commonace.js, no container is ever checked.
Also the problem needs a specific situation to really be noticeable.
Because in most cases the SOL filtering and the auto pairing (by IID) kind of mask the issue.
Here is my fix proposition:
acts.SetPosToObject = function (obj, imgpt)
{
var inst;
if(this.is_contained && obj.is_contained) {
for(var i = 0; i < this.siblings.length; i++){
var sibling = this.siblings[i];
if (sibling.type === obj) {
inst = sibling;
break;
}
}
} else {
inst = obj.getPairedInstance(this);
}
if (!inst)
return;
[/code:2banhj7z]
[url=https://app.box.com/s/e4bei0aoj8neqkbxabp3]setPositionToObject%26container.capx[/url]
[b]Description of Capx[/b]
When you click on the bluegray square its boolean "clicked" is set to true
If "clicked" is true for any bluegray square, the associated orange square should be positionned to the corresponding bluegray square
[b]Steps to Reproduce Bug[/b]
[ul]
[li] click on the bluegray squares in any order[/li][/ul]
[b]Observed Result[/b]
Various unexpected positionning
[b]Expected Result[/b]
Each orange square should go to its corresponding bluegray square because of the container pairing
[b]Affected Browsers[/b]
[ul]
[li] Chrome: (YES)
[/li][li] FireFox: (YES)
[/li][li] Internet Explorer: (YES)[/li][/ul]
[b]Operating System and Service Pack[/b]
Win7 SP1
[b]Construct 2 Version ID[/b]
r163