public ShapeTileBox surrounding_box(){
  if (is_clear())   return null;
  int llx=Integer.MAX_VALUE;
  int lly=Integer.MAX_VALUE;
  int urx=Integer.MIN_VALUE;
  int ury=Integer.MIN_VALUE;
  for (int layer_idx=0; layer_idx < layer_count; ++layer_idx) {
    OctagonMutable curr=octa_arr[layer_idx];
    llx=Math.min(llx,(int)Math.floor(curr.lx));
    lly=Math.min(lly,(int)Math.floor(curr.ly));
    urx=Math.max(urx,(int)Math.ceil(curr.rx));
    ury=Math.max(ury,(int)Math.ceil(curr.uy));
  }
  if (llx > urx || lly > ury) {
    return ShapeTileBox.EMPTY;
  }
  return new ShapeTileBox(llx,lly,urx,ury);
}

public ShapeTileBox surrounding_box ( ) { if ( is_clear ( ) ) return null ; int llx = Integer . MAX_VALUE ; int lly = Integer . MAX_VALUE ; int urx = Integer . MIN_VALUE ; int ury = Integer . MIN_VALUE ; for ( int layer_idx = 0 ; layer_idx < layer_count ; ++ layer_idx ) { OctagonMutable curr = octa_arr [ layer_idx ] ; llx = Math . min ( llx , ( int ) Math . floor ( curr . lx ) ) ; lly = Math . min ( lly , ( int ) Math . floor ( curr . ly ) ) ; urx = Math . max ( urx , ( int ) Math . ceil ( curr . rx ) ) ; ury = Math . max ( ury , ( int ) Math . ceil ( curr . uy ) ) ; } if ( llx > urx || lly > ury ) { return ShapeTileBox . EMPTY ; } return new ShapeTileBox ( llx , lly , urx , ury ) ; }
merge all info on all layers so you can update the gdi
