mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-05-10 20:11:33 +00:00
Added custom branch widths
This commit is contained in:
parent
99b92daa91
commit
8ae89bd098
6 changed files with 10 additions and 5 deletions
js/technical
|
@ -49,9 +49,11 @@ function drawTree() {
|
|||
function drawTreeBranch(num1, data, prefix) { // taken from Antimatter Dimensions & adjusted slightly
|
||||
let num2 = data
|
||||
let color_id = 1
|
||||
let width = 15
|
||||
if (Array.isArray(data)){
|
||||
num2 = data[0]
|
||||
color_id = data[1]
|
||||
width = data[2] || width
|
||||
}
|
||||
|
||||
if(typeof(color_id) == "number")
|
||||
|
@ -69,7 +71,7 @@ function drawTreeBranch(num1, data, prefix) { // taken from Antimatter Dimension
|
|||
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.lineWidth = width;
|
||||
ctx.beginPath();
|
||||
ctx.strokeStyle = color_id
|
||||
ctx.moveTo(x1, y1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue