Rev 18615 | Rev 18623 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18615 | Rev 18616 | ||
---|---|---|---|
Line 4446... | Line 4446... | ||
4446 | @ snaptopoints x1,y1,x2,y2,x3,y3.... |
4446 | @ snaptopoints x1,y1,x2,y2,x3,y3.... |
4447 | @ a userdraw object will snap to these points. |
4447 | @ a userdraw object will snap to these points. |
4448 | @ the array size (e.g. the number of points) of command ''snaptopoints`` is limited by constant MAX_INT (canvasdraw.h)<br>this command may be repeated multiple times (no limit) to add points |
4448 | @ the array size (e.g. the number of points) of command ''snaptopoints`` is limited by constant MAX_INT (canvasdraw.h)<br>this command may be repeated multiple times (no limit) to add points |
4449 | @ a draggable object (use command ''drag x|y|xy``) will snap to the closed of these points when dragged (mouseup) |
4449 | @ a draggable object (use command ''drag x|y|xy``) will snap to the closed of these points when dragged (mouseup) |
4450 | @ other options: use keyword ''snaptogrid``, ''xsnaptogrid`` or ''ysnaptogrid`` |
4450 | @ other options: use keyword ''snaptogrid``, ''xsnaptogrid`` or ''ysnaptogrid`` |
4451 | |
4451 | @%snaptopoints_1%size 400,400%xrange -5,5%yrange -5,5%snaptopoints -1,-3,-1,-2,-1,0,-1,1,-1,2,-1,3,1,-3,1,-2,1,-1,1,0,1,1,1,2,1,3%linewidth 2%points red,-1,-3,-1,-2,-1,0,-1,1,-1,2,-1,3,1,-3,1,-2,1,-1,1,0,1,1,1,2,1,3%userdraw arrows,red |
4452 | |
4452 | @%snaptopoints_2%size 400,400%xrange -5,5%yrange -5,5%snaptopoints -1,-3,-1,-2,-1,0,-1,1,-1,2,-1,3,1,-3,1,-2,1,-1,1,0,1,1,1,2,1,3%linewidth 3%%points blue,-1,-3,-1,-2,-1,0,-1,1,-1,2,-1,3,1,-3,1,-2,1,-1,1,0,1,1,1,2,1,3%drag xy%ftriangle -4,0,-2,3,0,0,red |
4453 | */ |
4453 | */ |
4454 | i = 0; |
4454 | i = 0; |
4455 | while( ! done ){ /* get next item until EOL*/ |
4455 | while( ! done ){ /* get next item until EOL*/ |
4456 | if(i > MAX_INT - 1){canvas_error("too many points in argument: repeat command multiple times to fit");} |
4456 | if(i > MAX_INT - 1){canvas_error("too many points in argument: repeat command multiple times to fit");} |
4457 | if(i%2 == 0 ){ |
4457 | if(i%2 == 0 ){ |