straight arrows
This commit is contained in:
parent
95acf5e09a
commit
d20c8114ef
@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
*CLIENT*
|
*CLIENT*
|
||||||
|
|
||||||
|
arrows alignment
|
||||||
purge green disable
|
purge green disable
|
||||||
rework scatter
|
rework scatter
|
||||||
hatred maybe
|
hatred maybe
|
||||||
|
|||||||
@ -37,18 +37,25 @@ class TargetSvg extends Component {
|
|||||||
? playerTeam.constructs.findIndex(c => c.id === cast.target_construct_id)
|
? playerTeam.constructs.findIndex(c => c.id === cast.target_construct_id)
|
||||||
: otherTeam.constructs.findIndex(c => c.id === cast.target_construct_id);
|
: otherTeam.constructs.findIndex(c => c.id === cast.target_construct_id);
|
||||||
|
|
||||||
|
const pathOffset = [
|
||||||
|
[0, -1, -2],
|
||||||
|
[1, 0, -1],
|
||||||
|
[2, 1, 0],
|
||||||
|
][source][target];
|
||||||
|
|
||||||
const sourceY = height;
|
const sourceY = height;
|
||||||
const sourceX = (source * width / 3) + width / 6;
|
const sourceX = (source * width / 3) + width / 6;
|
||||||
const targetX = (target * width / 3) + width / 6 + (defensive ? width / 32 : 0) + (source * width / 24) - (width / 24);
|
const targetX = (target * width / 3) + width / 6
|
||||||
|
+ (pathOffset * width / 32);
|
||||||
const targetY = defensive ? height : 0;
|
const targetY = defensive ? height : 0;
|
||||||
const curveEnd = height * 0.20;
|
const bendStart = height * (0.7 - 0.1 * source);
|
||||||
const curveStart = height * 0.80;
|
const bendEnd = height * 0.20;
|
||||||
|
|
||||||
if (defensive) {
|
if (defensive) {
|
||||||
const path = `
|
const path = `
|
||||||
M${sourceX},${sourceY}
|
M${sourceX},${sourceY}
|
||||||
L${sourceX},${height * 0.75}
|
L${sourceX},${bendStart}
|
||||||
L${targetX},${height * 0.75}
|
L${targetX},${bendStart}
|
||||||
L${targetX},${targetY}
|
L${targetX},${targetY}
|
||||||
L${targetX - (width * 0.005)},${height * 0.875}
|
L${targetX - (width * 0.005)},${height * 0.875}
|
||||||
M${targetX},${targetY}
|
M${targetX},${targetY}
|
||||||
@ -60,9 +67,8 @@ class TargetSvg extends Component {
|
|||||||
|
|
||||||
const path = `
|
const path = `
|
||||||
M${sourceX},${sourceY}
|
M${sourceX},${sourceY}
|
||||||
L${sourceX},${curveStart}
|
L${sourceX},${bendStart}
|
||||||
C${sourceX},${curveEnd} ${targetX},${curveStart} ${targetX},${curveEnd}
|
L${targetX},${bendEnd}
|
||||||
|
|
||||||
L${targetX},${targetY}
|
L${targetX},${targetY}
|
||||||
L${targetX - (width * 0.005)},${height * 0.125}
|
L${targetX - (width * 0.005)},${height * 0.125}
|
||||||
M${targetX},${targetY}
|
M${targetX},${targetY}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user