minor cleanup
This commit is contained in:
parent
e8d70bcdfb
commit
31bb10f87e
2 changed files with 5 additions and 5 deletions
|
@ -804,7 +804,7 @@ Encoding functions
|
||||||
str = Ox.encodeUTF8(str);
|
str = Ox.encodeUTF8(str);
|
||||||
var len = str.length, c = Ox.canvas(Math.ceil((4 + len) / 3), 1), data;
|
var len = str.length, c = Ox.canvas(Math.ceil((4 + len) / 3), 1), data;
|
||||||
str = Ox.pad(Ox.encodeBase256(len), 4, Ox.char(0)) + str +
|
str = Ox.pad(Ox.encodeBase256(len), 4, Ox.char(0)) + str +
|
||||||
+ Ox.repeat("\u00FF", (4 - len % 4) % 4); // simpler? Ox.pad()?
|
Ox.repeat("\u00FF", (4 - len % 4) % 4); // simpler? Ox.pad()?
|
||||||
/* fixme: why does map not work here?
|
/* fixme: why does map not work here?
|
||||||
c.data = $.map(c.data, function(v, i) {
|
c.data = $.map(c.data, function(v, i) {
|
||||||
return i % 4 < 3 ? str.charCodeAt(i - parseInt(i / 4)) : 255;
|
return i % 4 < 3 ? str.charCodeAt(i - parseInt(i / 4)) : 255;
|
||||||
|
@ -815,7 +815,7 @@ Encoding functions
|
||||||
}
|
}
|
||||||
c.context.putImageData(c.imageData, 0, 0);
|
c.context.putImageData(c.imageData, 0, 0);
|
||||||
data = atob(c.canvas.toDataURL().split(",")[1]);
|
data = atob(c.canvas.toDataURL().split(",")[1]);
|
||||||
Ox.print("deflate", len, "->", data.length - 20);
|
//Ox.print("deflate", len, "->", data.length - 20);
|
||||||
return data.substr(8, data.length - 20);
|
return data.substr(8, data.length - 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -823,7 +823,7 @@ Encoding functions
|
||||||
var image = new Image();
|
var image = new Image();
|
||||||
image.src = "data:image/png;base64," + btoa("\u0089PNG\r\n\u001A\n" +
|
image.src = "data:image/png;base64," + btoa("\u0089PNG\r\n\u001A\n" +
|
||||||
str + Ox.repeat("\u0000", 4) + "IEND\u00AEB`\u0082");
|
str + Ox.repeat("\u0000", 4) + "IEND\u00AEB`\u0082");
|
||||||
while(!image.width) {}
|
while (!image.width) {} // wait for image data
|
||||||
str = Ox.map(Ox.canvas(image).data, function(v, i) {
|
str = Ox.map(Ox.canvas(image).data, function(v, i) {
|
||||||
return i % 4 < 3 ? Ox.char(v) : "";
|
return i % 4 < 3 ? Ox.char(v) : "";
|
||||||
}).join("");
|
}).join("");
|
||||||
|
|
|
@ -1354,13 +1354,13 @@ requires
|
||||||
function mousedownLayer() {
|
function mousedownLayer() {
|
||||||
that.$layer.stop().animate({
|
that.$layer.stop().animate({
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
}, 100);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
function mouseupLayer() {
|
function mouseupLayer() {
|
||||||
that.$layer.stop().animate({
|
that.$layer.stop().animate({
|
||||||
opacity: 0
|
opacity: 0
|
||||||
}, 100);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
|
|
Loading…
Reference in a new issue