Quantcast

Rotate selection around image centre does not work for line selections

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Rotate selection around image centre does not work for line selections

Stein Rørvik
Thank you Wayne for your rapid response to the bugs I posted yesterday!
Here is another macro-reproducible problem:

Rotate selection around image centre does not work for line selections.
It works correctly for all other selection types.

The below macro illustrates the issue.
The selection is placed in the corner, rotated around itself, then rotated around the image centre.

saveSettings;
run("Colors...", "foreground=black background=white selection=red");
run("Close All");

newImage("Rectangle", "8-bit white", 500, 500, 1);
makeRectangle(50, 100, 100, 10);
for (i = 0; i<360; i+= 30) {
                run("Add Selection...");
                run("Rotate...", "  angle=30");
}
//ok

for (i = 0; i<360; i+= 30) {
                run("Add Selection...");
                run("Rotate...", "rotate angle=30");
}
//ok

newImage("Straight Line", "8-bit white", 500, 500, 1);
makeLine(50, 100, 150, 100);
for (i = 0; i<360; i+= 30) {
                run("Add Selection...");
                run("Rotate...", "  angle=30");
}
//ok

for (i = 0; i<360; i+= 30) {
                run("Add Selection...");
                run("Rotate...", "rotate angle=30");
}
//failed, the line was rotated around itself instead of the image centre

run("Tile");
restoreSettings;


Stein


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Loading...