Skip to content

Commit

Permalink
Merge pull request #160 from Strilanc/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Strilanc committed May 22, 2016
2 parents d504efb + ee4ccf2 commit 56c5bdc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "Quirk",
"description": "An HTML5 toy for exploring and understanding small quantum circuits.",
"license": "Apache-2.0",
"version": "1.2.0",
"version": "1.4.0",
"homepage": "https://github.com/Strilanc/Quirk",
"bugs": {
"url": "https://github.com/Strilanc/Quirk/issues"
Expand Down
13 changes: 8 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ canvas.width = canvasDiv.clientWidth;
canvas.height = window.innerHeight*0.9;
let haveLoaded = false;
let historyPusher = new HistoryPusher();
let semiStableRng = new RestartableRng();
setInterval(() => {
semiStableRng = new RestartableRng();
}, Config.SEMI_STABLE_RANDOM_VALUE_LIFETIME_MILLIS*0.95);
let semiStableRng = {cur: new RestartableRng()};
let cycleRng;
cycleRng = () => {
semiStableRng.cur = new RestartableRng();
setTimeout(cycleRng, Config.SEMI_STABLE_RANDOM_VALUE_LIFETIME_MILLIS*0.99);
};
cycleRng();

//noinspection JSValidateTypes
/** @type {!HTMLDivElement} */
Expand Down Expand Up @@ -143,7 +146,7 @@ const redrawNow = () => {
let size = desiredCanvasSizeFor(shown);
canvas.width = size.w;
canvas.height = size.h;
let painter = new Painter(canvas, semiStableRng.restarted());
let painter = new Painter(canvas, semiStableRng.cur.restarted());
shown.updateArea(painter.paintableArea());
shown.paint(painter, stats, isShiftHeld);
painter.paintDeferred();
Expand Down

0 comments on commit 56c5bdc

Please sign in to comment.