Hi Michael,
Thanks for the explanation. It sounds like it might be more trouble than its worth though and I can easily trap for the case where the user didn’t click on the corner points.
But I'm curious and I’m thinking that I don’t quite understand the SnapFunc, specifically how to pass the points into it? This should illustrate my confusion:
code:
function SnapFunc( pointpicker)
{
// how do the corners get passed in?
for ( i = 0; i < corners.length; i++)
{
pointpicker.setSnapFuncPoint( corners[ i], 'corner ' + i );
}
}
[...]
// code that would set up and call the pointpicker...
// Find the longest line (width) and corners
var width = 0;
var corners = new Array;
for ( var i = 0; i < lines.length; i++)
{
var line = lines.item( i);
var length = round( line.getLength());
if ( length >= width)
{
width = length;
corners.push( line.getStartPt());
corners.push( line.getEndPt());
}
}
pointpicker.addSnapFunc( SnapFunc );
^^^^^^^^^^
Do corners get passed in here?
--Larry
|