Holding constant angle while using line tool



I’m measuring some distances on ImageJ but I either want to hold the line angle at 0 degrees or 90 degrees. Is there a way to set a constant line angle?


@Ecg, glad your problem is solved! Do you mind posting the URL to the macro so that others having the same issue can also solve it?


Sure thing!
The following tool macro allows you to draw lines with constant angle. To
change this angle, open the tool’s options dialog by double clicking on the
tool icon, or adjust the angle manually by pressing the ‘alt’ key while
dragging the mouse. Also while dragging, the ‘shift’ key will measure the
current line.

// Fixed Angle Line Tool Macro 
var a=0; 
var pi=3.1415926535; 
var leftClick=16; 
macro 'Fixed Angle Line Tool - C000L05f0L0af5' { 
getCursorLoc(x1, y1, z, flags); 
while (true) { 
  getCursorLoc(x2, y2, z, flags); 
  if (flags&leftClick==0) exit(); 
  if (x2!=x1 || y2!=y1) { 
    dx=(x2-x1); dy=(y2-y1); 
    if (isKeyDown('alt')) { 
    } else if (isKeyDown('shift')) { 
     run ('Measure'); 
    } else { 

macro 'Fixed Angle Line Tool Options' { 
da=getNumber("fixed angle",da); 
a= pi*da/180; 

// end