diff --git a/changelog.md b/changelog.md index 3755e7c..92f0960 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ # The Modding Tree changelog: +- Fixed tree branches being offset. + ### v2.2.1 - 11/7/20 - Added a small highlight to layers you can meaningfully prestige on. - Added passiveGeneration and autoPrestige features to standardize prestige automation. (The old ways still work, but the new ones work better with other things) diff --git a/js/technical/canvas.js b/js/technical/canvas.js index 5505be3..9ab7a88 100644 --- a/js/technical/canvas.js +++ b/js/technical/canvas.js @@ -66,10 +66,10 @@ function drawTreeBranch(num1, data) { // taken from Antimatter Dimensions & adju let start = document.getElementById(num1).getBoundingClientRect(); let end = document.getElementById(num2).getBoundingClientRect(); - let x1 = start.left + (start.width / 2) + (document.getElementById("treeTab").scrollLeft || document.body.scrollLeft); - let y1 = start.top + (start.height / 2) + (document.getElementById("treeTab").scrollTop || document.body.scrollTop); - let x2 = end.left + (end.width / 2) + (document.getElementById("treeTab").scrollLeft || document.body.scrollLeft); - let y2 = end.top + (end.height / 2) + (document.getElementById("treeTab").scrollTop || document.body.scrollTop); + let x1 = start.left + (start.width / 2) + document.body.scrollLeft; + let y1 = start.top + (start.height / 2) + document.body.scrollTop; + let x2 = end.left + (end.width / 2) + document.body.scrollLeft; + let y2 = end.top + (end.height / 2) + document.body.scrollTop; ctx.lineWidth = 15; ctx.beginPath(); ctx.strokeStyle = color_id