In refactoring my code to avoid calling the innerHtml
member, a new bug crept up. I only converted html strings to DOM calls. No bugs are thrown in the chromium inspector. I am using mercurial, and the old version still works. I hunted around and:
alert(ctx.getTransform());
Returns 1,0,0,1,0,0
which is the identity transform. But my canvas is still scaled wrong. I don't call anything other than basic line and stroke members.
function buildColorTool() {
var pick = document.createElement("DIV");
var canvas = document.createElement("canvas");
canvas.style.width = "200px";
canvas.style.height = "200px";
canvas.id = "wheelCanvas";
pick.appendChild(canvas);
document.getElementById("toolWindow").appendChild(pick);
}
Is broken, but:
function buildColorTool() {
let toolWindow = "<div class=\"toolDialogue\">";
toolWindow += " <div id=\"colorPicker\">";
toolWindow += " <canvas id=\"wheelCanvas\" width=\"200\" height=\"200\"></canvas>";
toolWindow += " </div>";
toolWindow += " </div>";
document.getElementById("toolWindow").innerHTML = toolWindow;
}
Works.
I used hg diff -c 25 ./script.js > changes.txt
, is there a better set of mercurial arguments for posting to stack exchange?