/** Adds a horizontal match with the center axis of the GridLayout */ private void addCenterColumnMatch( Rect bounds, int x1, int y1, int x2, int y2, List<GridMatch> columnMatches, int max) { Collection<INode> intersectsRow = mGrid.getIntersectsRow(y1, y2); if (intersectsRow.size() == 0) { // Offer centering on this row since there isn't anything there int matchedLine = bounds.centerX(); int distance = abs((x1 + x2) / 2 - matchedLine); if (distance <= 2 * max) { boolean createCell = false; // always just put in column 0 columnMatches.add( new GridMatch( SegmentType.CENTER_HORIZONTAL, distance, matchedLine, 0 /* column */, createCell, UNDEFINED)); } } }