|
|
|
@@ -51,6 +51,8 @@ let rulers = []; |
|
|
|
|
|
|
|
let currentRuler = undefined; |
|
|
|
|
|
|
|
let webkitCanvasBug = false; |
|
|
|
|
|
|
|
const tagDefs = { |
|
|
|
"anthro": "Anthro", |
|
|
|
"feral": "Feral", |
|
|
|
@@ -2050,10 +2052,14 @@ function rotate(point, angle) { |
|
|
|
|
|
|
|
const testCtx = testCanvas.getContext("2d"); |
|
|
|
function testClick(event) { |
|
|
|
const target = event.target; |
|
|
|
|
|
|
|
if (webkitCanvasBug) |
|
|
|
{ |
|
|
|
return clickDown(target.parentElement, event.clientX, event.clientY); |
|
|
|
} |
|
|
|
testCtx.save(); |
|
|
|
|
|
|
|
const target = event.target; |
|
|
|
if (rulerMode) { |
|
|
|
return; |
|
|
|
} |
|
|
|
@@ -4333,6 +4339,21 @@ document.addEventListener("DOMContentLoaded", () => { |
|
|
|
|
|
|
|
document.querySelector("#search-box").addEventListener("change", e => doSearch(e.target.value)); |
|
|
|
|
|
|
|
// Webkit doesn't draw resized SVGs correctly. It will always draw them at their intrinsic size, I think |
|
|
|
// This checks for that. |
|
|
|
webkitBugTest.onload = () => { |
|
|
|
testCtx.canvas.width = 500; |
|
|
|
testCtx.canvas.height = 500; |
|
|
|
testCtx.clearRect(0, 0, 500, 500); |
|
|
|
testCtx.drawImage(webkitBugTest, 0, 0, 500, 500); |
|
|
|
webkitCanvasBug = testCtx.getImageData(250, 250, 1, 1).data[3] == 0 |
|
|
|
|
|
|
|
if (webkitCanvasBug) { |
|
|
|
toast("Heads up: Safari can't select through gaps or take screenshots (check the console for info!)") |
|
|
|
console.log("Webkit messes up the process of drawing an SVG image to a canvas. This is important for both selecting things (it lets you click through a gap and hit something else) and for taking screenshots (since it needs to render them to a canvas). Sorry :(") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
let searchText = ""; |
|
|
|
|