JavaScript How to make a parallel lines drawing make parallel lines in illustrator,make parallel lines photoshop,make

I have this [sample][1], what I want is to have this result[![enter image description here][2]][2]

Note:

a.) 1 and 2 will be connected while 3 will be produced in the third mousedown click.

b.) 1,2,3 should be declared continously.

c.) 1 and 2 can be extend for the width

d.) 3 should be extend for the height.

e.) 1,2,3 should be drag as a whole (all together).

f.) The pattern of declaration is 1 to 2 (horizontally) and 2 to 3 (vertical).

function handleMouseDown(e){
// tell the browser we're handling this event
e.preventDefault();
e.stopPropagation();

startX=parseInt(e.clientX-offsetX);
startY=parseInt(e.clientY-offsetY);

draggingIndex=-1;
for(var i=0;i<anchors.length;i++){
    var a=anchors[i];
    var dx=startX-a.x;
    var dy=startY-a.y;
    if(dx*dx+dy*dy<radius*radius){
        draggingIndex=i;
        break;
    }
}

//Detect if we're on a line:
fullDrag = mouseOnLine({x:startX, y: startY});

// If a drag hasn't started, add another anchor here
if(draggingIndex==-1 && fullDrag == null){
    addAnchor(startX,startY);
    var al = anchors.length-1;
    var almod4 = al%2;
    if(almod4==1){
        connectors.push({start:al-1,end:al});
    }
    if(almod4==2){
        connectors.push({start:al-2,end:al});
        connectors.push({start:al-1,end:al});
    }
    draw();
}
}
Answer:1

I have this clock object: var Clock = { start: function () { $('#btnScrollPause').show(); $('#btnScrollResume').hide(); advance(); this.interval = setInterval(function () ...

I have this clock object: var Clock = { start: function () { $('#btnScrollPause').show(); $('#btnScrollResume').hide(); advance(); this.interval = setInterval(function () ...

  1. callback in this.setstate
  2. javascript callback with this
  3. typescript callback with this
  4. js callback with this
  5. callback function with this
  6. c++ callback with this
  7. jquery callback with this
  8. javascript pass callback with this
  9. javascript callback function with this
  10. typescript callback function with this

I'am studying React JS library, and i wish create a "loop" of component, returning array values from json file. Here my json file: { "data": { "children": [{ "data": { "score": 4 ...

I'am studying React JS library, and i wish create a "loop" of component, returning array values from json file. Here my json file: { "data": { "children": [{ "data": { "score": 4 ...

  1. loop component in react
  2. loop component in talend
  3. create react component with loop

I have the following django template and I have defined a button in it so that it calls the javascript function which I added to the page like below. I have the below issues: 1) If I bring the script ...

I have the following django template and I have defined a button in it so that it calls the javascript function which I added to the page like below. I have the below issues: 1) If I bring the script ...

I am trying to make a table using jquery-datatables with the header shown below: <table id="tableau" class="display" width="100%" align="center"> <thead> <tr> <th ...

I am trying to make a table using jquery-datatables with the header shown below: <table id="tableau" class="display" width="100%" align="center"> <thead> <tr> <th ...

  1. issue when using