Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<pre><code>public function split(onGroup:CellGroup, directionToMoveSplitCells:String):CellGroup { if (!hasIntersection(onGroup)) return this; var newGroup:CellGroup; if (directionToMoveSplitCells == "RIGHT") { newGroup = splitGroupAndMoveSplitCellsRight(onGroup); if (!newGroup) return; insertAsNextGroupInLinkedList(newGroup); } else { newGroup = splitGroupAndMoveSplitCellsLeft(onGroup); if (!newGroup) return; insertAsPreviousGroupInLinkedList(newGroup); x = (onGroup.endIndex + 1) * cellSize.width; } removeArrayOfCellsFromGroup(splitCells); row.joinGroups(); row.updateGroupIndices(); repositionCellsInGroup(); return newGroup; } private function splitGroupAndMoveSplitCellsRight(onGroup:CellGroup):CellGroup { var numCellsToSplit:int = endIndex - onGroup.startIndex + 1; var splitStartIndex:int = length - numberOfCellsToSplit; var splitCells:Array = trimCells(splitStartIndex, numberOfCellsToSplit); if (!splitCells.length) return null; var resultingGroupStartIndex:int = onGroup.endIndex + 1; return row.createGroup(splitCells, resultingGroupStartIndex); } private function splitGroupAndMoveSplitCellsLeft(onGroup:CellGroup):CellGroup { var numCellsToSplit:int = onGroup.endIndex - startIndex + 1; var splitStartIndex:int = 0; var splitCells:Array = trimCells(splitStartIndex, numberOfCellsToSplit); if (!splitCells.length) return null; var resultingGroupStartIndex:int = onGroup.startIndex - splitCells.length; return row.createGroup(splitCells, resultingGroupStartIndex); } private function insertAsNextGroupInLinkedList(group:CellGroup):void { var currentNextGroup:CellGroup = nextGroup; if (currentNextGroup) { group.nextGroup = currentNextGroup; currentNextGroup.previousGroup = group; } group.previousGroup = this; nextGroup = group; } private function insertAsPreviousGroupInLinkedList(group:CellGroup):void { var currentPreviousGroup:CellGroup = previousGroup; if (currentPreviousGroup) { group.previousGroup = currentPreviousGroup; currentPreviousGroup.nextGroup = group; } group.nextGroup = this; previousGroup = group; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload