@@ -210,7 +210,6 @@ public void update(Graphics g) {
210210 }
211211
212212 public void paint (Graphics g ) {
213- // if (IJ.debugMode) IJ.log("paint: "+imp);
214213 painted = true ;
215214 Roi roi = imp .getRoi ();
216215 Overlay overlay = imp .getOverlay ();
@@ -301,7 +300,6 @@ private void drawOverlay(Overlay overlay, Graphics g) {
301300 if (labelColor ==null ) labelColor = Color .white ;
302301 initGraphics (overlay , g , labelColor , Roi .getColor ());
303302 int n = overlay .size ();
304- //if (IJ.debugMode) IJ.log("drawOverlay: "+n);
305303 int currentImage = imp !=null ?imp .getCurrentSlice ():-1 ;
306304 int stackSize = imp .getStackSize ();
307305 if (stackSize ==1 )
@@ -338,14 +336,13 @@ private void drawOverlay(Overlay overlay, Graphics g) {
338336 int t = roi .getTPosition ();
339337 if (hyperstack ) {
340338 int position = roi .getPosition ();
341- //IJ.log(c+" "+z+" "+t+" "+channel+" "+position+" "+roiManagerShowAllMode);
342339 if (position >0 ) {
343340 if (z ==0 && imp .getNSlices ()>1 )
344341 z = position ;
345342 else if (t ==0 )
346343 t = position ;
347344 }
348- //IJ.log("drawOverlay: i="+i+", pos="+roi.getPosition());
345+ //IJ.log("drawOverlay: i="+i+", pos="+roi.getPosition()+" "+c+" "+z+" "+t );
349346 if (((c ==0 ||c ==channel ) && (z ==0 ||z ==slice ) && (t ==0 ||t ==frame )) || roiManagerShowAllMode || position == PointRoi .POINTWISE_POSITION )
350347 drawRoi (g , roi , drawLabels ?i +LIST_OFFSET :-1 );
351348 } else {
@@ -364,7 +361,6 @@ else if (t==1)
364361 position = 0 ;
365362 if ((roi instanceof PointRoi ) && Prefs .showAllPoints )
366363 position = 0 ;
367- //IJ.log("drawOverlay: i="+i+", pos="+roi.getPosition()+", pos2="+position);
368364 if (position ==0 || position ==currentImage || roiManagerShowAllMode )
369365 drawRoi (g , roi , drawLabels ?i +LIST_OFFSET :-1 );
370366 }
@@ -496,7 +492,6 @@ void drawRoiLabel(Graphics g, int index, Roi roi) {
496492 } else
497493 labelRects [index ] = new Rectangle (x -3 , y -h +1 , w +4 , h );
498494 }
499- //IJ.log("drawRoiLabel: "+" "+label+" "+x+" "+y+" "+flattening);
500495 g .setColor (labelColor );
501496 g .drawString (label , x +xoffset , y -2 +yoffset );
502497 g .setColor (defaultColor );
@@ -743,7 +738,6 @@ void setMagnification2(double magnification) {
743738 /** Resizes the canvas when the user resizes the window. */
744739 void resizeCanvas (int width , int height ) {
745740 ImageWindow win = imp .getWindow ();
746- //IJ.log("resizeCanvas: "+srcRect+" "+imageWidth+" "+imageHeight+" "+width+" "+height+" "+dstWidth+" "+dstHeight+" "+win.maxBounds);
747741 if (!maxBoundsReset && (width >dstWidth ||height >dstHeight )&&win !=null &&win .maxBounds !=null &&width !=win .maxBounds .width -10 ) {
748742 if (resetMaxBoundsCount !=0 )
749743 resetMaxBounds (); // Works around problem that prevented window from being larger than maximized size
@@ -768,7 +762,6 @@ void resizeCanvas(int width, int height) {
768762 srcRect .y = imageHeight -srcRect .height ;
769763 repaint ();
770764 }
771- //IJ.log("resizeCanvas2: "+srcRect+" "+dstWidth+" "+dstHeight+" "+width+" "+height);
772765 }
773766
774767 public void fitToWindow () {
@@ -870,7 +863,6 @@ public void zoomIn(int sx, int sy) {
870863
871864 /** Centers the viewable area on offscreen (image) coordinates x, y */
872865 void adjustSourceRect (double newMag , int x , int y ) {
873- //IJ.log("adjustSourceRect1: "+newMag+" "+dstWidth+" "+dstHeight);
874866 int w = (int )Math .round (dstWidth /newMag );
875867 if (w *newMag <dstWidth ) w ++;
876868 int h = (int )Math .round (dstHeight /newMag );
@@ -882,7 +874,6 @@ void adjustSourceRect(double newMag, int x, int y) {
882874 if (r .y +h >imageHeight ) r .y = imageHeight -h ;
883875 srcRect = r ;
884876 setMagnification (newMag );
885- //IJ.log("adjustSourceRect2: "+srcRect+" "+dstWidth+" "+dstHeight);
886877 }
887878
888879 /** Returns the size to which the window can be enlarged, or null if it can't be enlarged.
@@ -949,12 +940,10 @@ public void zoomOut(int sx, int sy) {
949940 if (newSrcX <0 ) newSrcX = 0 ;
950941 if (newSrcY <0 ) newSrcY = 0 ;
951942 srcRect = new Rectangle (newSrcX , newSrcY , newSrcWidth , newSrcHeight );
952- //IJ.log(newMag+" "+srcRect+" "+dstWidth+" "+dstHeight);
953- int newDstWidth = (int )(srcRect .width *newMag );
943+ int newDstWidth = (int )(srcRect .width *newMag );
954944 int newDstHeight = (int )(srcRect .height *newMag );
955945 setMagnification (newMag );
956946 setMaxBounds ();
957- //IJ.log(newDstWidth+" "+dstWidth+" "+newDstHeight+" "+dstHeight);
958947 if (newDstWidth <dstWidth || newDstHeight <dstHeight ) {
959948 setSize (newDstWidth , newDstHeight );
960949 imp .getWindow ().pack ();
@@ -1034,7 +1023,6 @@ public void zoom100Percent() {
10341023 protected void scroll (int sx , int sy ) {
10351024 int ox = xSrcStart + (int )(sx /magnification ); //convert to offscreen coordinates
10361025 int oy = ySrcStart + (int )(sy /magnification );
1037- //IJ.log("scroll: "+ox+" "+oy+" "+xMouseStart+" "+yMouseStart);
10381026 int newx = xSrcStart + (xMouseStart -ox );
10391027 int newy = ySrcStart + (yMouseStart -oy );
10401028 if (newx <0 ) newx = 0 ;
@@ -1043,7 +1031,6 @@ protected void scroll(int sx, int sy) {
10431031 if ((newy +srcRect .height )>imageHeight ) newy = imageHeight -srcRect .height ;
10441032 srcRect .x = newx ;
10451033 srcRect .y = newy ;
1046- //IJ.log(sx+" "+sy+" "+newx+" "+newy+" "+srcRect);
10471034 imp .draw ();
10481035 Thread .yield ();
10491036 }
@@ -1056,7 +1043,6 @@ Color getColor(int index){
10561043 /** Sets the foreground drawing color (or background color if
10571044 'setBackground' is true) to the color of the pixel at (ox,oy). */
10581045 public void setDrawingColor (int ox , int oy , boolean setBackground ) {
1059- //IJ.log("setDrawingColor: "+setBackground+this);
10601046 int type = imp .getType ();
10611047 int [] v = imp .getPixel (ox , oy );
10621048 switch (type ) {
@@ -1260,7 +1246,6 @@ public void run() {
12601246 && r2 .y ==r1 .y && r2 .width ==r1 .width && r2 .height ==r1 .height && size2 ==size1
12611247 && !(size2 >1 &&state ==Roi .CONSTRUCTING );
12621248 boolean cursorMoved = !getCursorLoc ().equals (cursorLoc );
1263- //IJ.log(size2+" "+empty+" "+unchanged+" "+state+" "+roi1+" "+roi2);
12641249 if ((roi1 ==null && (size2 <=1 ||empty )) || unchanged ) {
12651250 if (roi1 ==null ) imp .deleteRoi ();
12661251 if (!cursorMoved && Toolbar .getToolId ()!=Toolbar .HAND )
@@ -1355,7 +1340,6 @@ public void mouseDragged(MouseEvent e) {
13551340 yMouse = offScreenY (y );
13561341 flags = e .getModifiers ();
13571342 mousePressedX = mousePressedY = -1 ;
1358- //IJ.log("mouseDragged: "+flags);
13591343 if (flags ==0 ) // workaround for Mac OS 9 bug
13601344 flags = InputEvent .BUTTON1_MASK ;
13611345 if (Toolbar .getToolId ()==Toolbar .HAND || IJ .spaceBarDown ())
@@ -1465,7 +1449,6 @@ else if (e.isAltDown())
14651449 roi .modState = Roi .SUBTRACT_FROM_ROI ;
14661450 else
14671451 roi .modState = Roi .NO_MODS ;
1468- //IJ.log("setRoiModState: "+roi.modState+" "+ roi.state);
14691452 }
14701453
14711454 /** Disable/enable popup menu. */
@@ -1670,7 +1653,6 @@ private boolean activateOverlayRoi(int ox, int oy) {
16701653 Roi roi = o .get (i );
16711654 if (roi ==null )
16721655 continue ;
1673- //IJ.log(".isAltDown: "+roi.contains(ox, oy));
16741656 boolean containsMousePoint = false ;
16751657 if (roi instanceof Line ) { //grab line roi near its center
16761658 double grabLineWidth = 1.1 + 5. /magnification ;
0 commit comments