new Ruler(viewer, pixelSize [, options])
Creates a new Ruler instance.
Parameters:
Name | Type | Argument | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
viewer |
Viewer | The OpenLIME viewer instance |
|||||||||||||||||||||||||||||||
pixelSize |
number | Size of a pixel in real-world units |
|||||||||||||||||||||||||||||||
options |
Object |
<optional> |
Configuration options Properties
|
Methods
-
clear()
-
Clears all measurements. Removes all SVG elements and resets measurement history.
-
end()
-
Deactivates the ruler tool. Restores original cursor and clears current measurement.
-
start()
-
Activates the ruler tool. Creates SVG elements if needed and sets up event listeners. Changes cursor to indicate tool is active.