|
434 | 434 | return el.size.height |
435 | 435 | } |
436 | 436 |
|
| 437 | + |
| 438 | + for (x, y, target, wire-style, labels) in vertical-wires { |
| 439 | + let dx = center-x-coords.at(x) |
| 440 | + let (dy1, dy2) = (center-y-coords.at(y), center-y-coords.at(y + target)) |
| 441 | + dy1 += get-anchor-height(x, y) / 2 * signum(target) |
| 442 | + dy2 -= get-anchor-height(x, y + target) / 2 * signum(target) |
| 443 | + |
| 444 | + if labels.len() == 0 { |
| 445 | + draw-functions.draw-vertical-wire( |
| 446 | + dy1, dy2, dx, |
| 447 | + utility.update-stroke(wire, wire-style.stroke), |
| 448 | + wire-count: wire-style.count, |
| 449 | + ) |
| 450 | + } else { |
| 451 | + let (result, gate-bounds) = draw-functions.draw-vertical-wire-with-labels( |
| 452 | + dy1, dy2, dx, |
| 453 | + wire, wire-count: wire-style.count, |
| 454 | + wire-labels: labels, |
| 455 | + draw-params: draw-params |
| 456 | + ) |
| 457 | + result |
| 458 | + bounds = layout.update-bounds(bounds, gate-bounds) |
| 459 | + } |
| 460 | + } |
437 | 461 |
|
438 | 462 |
|
439 | 463 | for (row, wire-in) in wire-instructions.enumerate() { |
|
473 | 497 | } |
474 | 498 |
|
475 | 499 |
|
476 | | - for (x, y, target, wire-style, labels) in vertical-wires { |
477 | | - let dx = center-x-coords.at(x) |
478 | | - let (dy1, dy2) = (center-y-coords.at(y), center-y-coords.at(y + target)) |
479 | | - dy1 += get-anchor-height(x, y) / 2 * signum(target) |
480 | | - dy2 -= get-anchor-height(x, y + target) / 2 * signum(target) |
481 | | - |
482 | | - if labels.len() == 0 { |
483 | | - draw-functions.draw-vertical-wire( |
484 | | - dy1, dy2, dx, |
485 | | - utility.update-stroke(wire, wire-style.stroke), |
486 | | - wire-count: wire-style.count, |
487 | | - ) |
488 | | - } else { |
489 | | - let (result, gate-bounds) = draw-functions.draw-vertical-wire-with-labels( |
490 | | - dy1, dy2, dx, |
491 | | - wire, wire-count: wire-style.count, |
492 | | - wire-labels: labels, |
493 | | - draw-params: draw-params |
494 | | - ) |
495 | | - result |
496 | | - bounds = layout.update-bounds(bounds, gate-bounds) |
497 | | - } |
498 | | - } |
499 | | - |
500 | 500 |
|
501 | 501 | for gate-info in single-qubit-gates { |
502 | 502 | let (gate, size, x, y) = gate-info |
|
0 commit comments