MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / pathStringForTwoLineHandles

Function pathStringForTwoLineHandles

lib/web/brackets.js:139–166  ·  view source on GitHub ↗
(lh1, lh2, level)

Source from the content-addressed store, hash-verified

137}
138
139function pathStringForTwoLineHandles(lh1, lh2, level) {
140 r1 = rectForLineHandle(lh1);
141 r2 = rectForLineHandle(lh2);
142
143 if (r1 && r2) {
144 sz = (r2.bottom - r1.top) / 8;
145 sz = -18 + level * 7;
146 r2.bottom -= 8;
147 r1.top -= 8;
148
149 w = 30 + sz - 10;
150 w2 = 48;
151 w3 = 10 + sz - 10;
152 w3 = sz;
153 // return
154 // "M" + w2 + "," + r1.top + "L" + w + "," + r1.top + "C" + (-8 + w3) + "," + r1.top + "," + (20 + w3) + "," +
155 // ((r1.top + r2.bottom) / 2) + "," + w3 + "," + ((r1.top + r2.bottom) / 2) + "C" + (20 + w3) + "," + ((r1.top +
156 // r2.bottom) / 2) + "," + (-8 + w3) + "," + r2.bottom + "," + w + "," + r2.bottom + "L" + w2 + "," + r2.bottom;
157 // return "M"+w2+","+r1.top+"L"+w+","+r1.top+"L"+w+","+r2.bottom+"L"+w2+","+r2.bottom;
158
159 rr = -10;
160
161 return "M" + w2 + "," + (r1.top+1) + "L" + (w - rr) + "," + (r1.top+1) + "Q" + w
162 + "," + (r1.top+1) + "," + w + "," + (r1.top +1 - rr) + "L" + w + "," + (r2.bottom -1+ rr)
163 + "Q" + w + "," + (r2.bottom+1-1) + "," + (w - rr) + "," + (r2.bottom+1-1) + "L" + w2 + "," + (r2.bottom+1-1);
164 }
165 return null;
166}
167
168raph.clear();
169

Callers 2

makePathForHandlesFunction · 0.85
brackets.jsFile · 0.85

Calls 1

rectForLineHandleFunction · 0.85

Tested by

no test coverage detected