Skip to content

Commit

Permalink
Update negate gate symbol to be a single thick line
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Jul 7, 2017
1 parent 8ac5e14 commit 826d3b4
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/gates/Joke_NeGate.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
import {GateBuilder} from "src/circuit/Gate.js"
import {Matrix} from "src/math/Matrix.js"
import {Point} from "src/math/Point.js"
import {GatePainting} from "src/draw/GatePainting.js"

const NeGate = new GateBuilder().
setSerializedId("NeGate").
setSymbol("-I").
setTitle("Ne-Gate").
setBlurb("Negates all amplitudes.").
setDrawer(args => {
GatePainting.paintLocationIndependentFrame(args);
let {x, y} = args.rect.center();
args.painter.print(
"-I",
x,
y,
'center',
'middle',
'black',
'16px monospace',
args.rect.w,
args.rect.h);
args.painter.strokeLine(new Point(x - 6, y), new Point(x + 6, y), 'black', 2);
}).
setKnownEffectToMatrix(Matrix.square(-1, 0, 0, -1)).
gate;
Expand Down

0 comments on commit 826d3b4

Please sign in to comment.