outline[x] = oAfterLowerRightCorner; outline[x].append(x, y); outline[x + 1].prepend(x + 1, y); } else { outline[x + 1] = outline[x]; outline[x] = null; outline[x + 1].prepend(x + 1, y); outline[x + 1].prepend(x + 1,y); xAfterLowerRightCorner = x + 1; oAfterLowerRightCorner = outline[x + 1]; outline[x].prepend(outline[x + 1]); // merge for (int x1 = 0; x1 <= w; x1++) if (x1 != x + 1 && outline[x1] == outline[x + 1]) { outline[x] = outline[x + 1]; outline[x + 1] = null; outline[x].prepend(x, y); outline[x + 1] = outline[x]; outline[x] = oAfterLowerRightCorner; outline[x].prepend(x, y); outline[x + 1].append(x + 1, y); } else { && thisRow[x + 2] && !prevRow[x + 2]) { //at lower right corner && next pxl selected outline[x].append(x + 1, y); outline[x + 1].prepend(x + 1,y);
outline[x] = oAfterLowerRightCorner; outline[x].append(x, y); outline[x + 1].prepend(x + 1, y); } else { outline[x + 1] = outline[x]; outline[x] = null; outline[x + 1].prepend(x + 1, y); outline[x + 1].prepend(x + 1,y); xAfterLowerRightCorner = x + 1; oAfterLowerRightCorner = outline[x + 1]; outline[x].prepend(outline[x + 1]); // merge for (int x1 = 0; x1 <= w; x1++) if (x1 != x + 1 && outline[x1] == outline[x + 1]) { outline[x] = outline[x + 1]; outline[x + 1] = null; outline[x].prepend(x, y); outline[x + 1] = outline[x]; outline[x] = oAfterLowerRightCorner; outline[x].prepend(x, y); outline[x + 1].append(x + 1, y); } else { && thisRow[x + 2] && !prevRow[x + 2]) { //at lower right corner && next pxl selected outline[x].append(x + 1, y); outline[x + 1].prepend(x + 1,y);