Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== diff -u -ree9151268fa918fe7122d89811f87f6943256dea -r6dcdc31ee601bf462443a795ba7f74b0eb7a4155 --- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision ee9151268fa918fe7122d89811f87f6943256dea) +++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 6dcdc31ee601bf462443a795ba7f74b0eb7a4155) @@ -443,18 +443,22 @@ * Draws a Gate activity */ gate : function(x, y) { + if (x == undefined || y == undefined) { x = this.items.getBBox().x; y = this.items.getBBox().y; } + + x = Math.round(x); + y = Math.round(y); if (this.items) { this.items.remove(); } x = GeneralLib.snapToGrid(x); // make the icon more centred - y = GeneralLib.snapToGrid(y) - 20; + y = GeneralLib.snapToGrid(y); // create activity SVG elements var shape = ActivityLib.getActivityIcon('gate'); Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== diff -u -ref32c5d5a859467fe2a98b31251041d4e0c0582c -r6dcdc31ee601bf462443a795ba7f74b0eb7a4155 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision ef32c5d5a859467fe2a98b31251041d4e0c0582c) +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js (.../authoringGeneral.js) (revision 6dcdc31ee601bf462443a795ba7f74b0eb7a4155) @@ -260,9 +260,9 @@ if (learningLibraryID == 'grouping'){ activity = new ActivityDefs.GroupingActivity(null, null, x, y) } else if (learningLibraryID == 'gate'){ - activity = new ActivityDefs.GateActivity(null, null, x, y + 40); + activity = new ActivityDefs.GateActivity(null, null, x, GeneralLib.snapToGrid(y) + 20); } else if (learningLibraryID == 'branching') { - activity = new ActivityDefs.BranchingEdgeActivity(null, null, x, y, null, false, null, null); + activity = new ActivityDefs.BranchingEdgeActivity(null, null, x, y + 10, null, false, null, null); } else if (learningLibraryID == 'optional'){ activity = new ActivityDefs.OptionalActivity(null, null, x, y); } else if (learningLibraryID == 'floating') { @@ -295,7 +295,8 @@ ActivityLib.dropActivity(activity, eventX, eventY); if (activity instanceof ActivityDefs.BranchingEdgeActivity) { - let branchingEnd = new ActivityDefs.BranchingEdgeActivity(null, null, GeneralLib.snapToGrid(x + 120), y, null, false, null, activity.branchingActivity); + let branchingEnd = new ActivityDefs.BranchingEdgeActivity(null, null, + GeneralLib.snapToGrid(x + 120), y + 10, null, false, null, activity.branchingActivity); layout.activities.push(branchingEnd); } } @@ -1416,7 +1417,7 @@ if (activity instanceof ActivityDefs.GateActivity) { // adjust placement for gate activity, so it's in the middle of its cell x += 70; - y += 30; + y += 20; } activity.draw(x, y);