Sfoglia il codice sorgente

bright links

tags/v0.2.0^2
big bad waffle 6 anni fa
parent
commit
d42da58252
1 ha cambiato i file con 7 aggiunte e 3 eliminazioni
  1. +7
    -3
      helpers/passives/client/js/renderer.js

+ 7
- 3
helpers/passives/client/js/renderer.js Vedi File

@@ -74,7 +74,11 @@ define([

renderNodes: function (nodes, links) {
links.forEach(function (l) {
this.renderers.line.call(this, l.from, l.to);
var linked = (
nodes.find(n => (n == l.from)).selected &&
nodes.find(n => (n == l.to)).selected
);
this.renderers.line.call(this, l.from, l.to, linked);
}, this);

nodes.forEach(function (n) {
@@ -160,7 +164,7 @@ define([
}
},

line: function (fromNode, toNode) {
line: function (fromNode, toNode, linked) {
var ctx = this.ctx;
var halfSize = constants.blockSize / 2;

@@ -170,7 +174,7 @@ define([
var toX = (toNode.pos.x * constants.gridSize) + halfSize - this.pos.x;
var toY = (toNode.pos.y * constants.gridSize) + halfSize - this.pos.y;

ctx.strokeStyle = '#69696e';
ctx.strokeStyle = linked ? '#fafcfc' : '#69696e';
ctx.beginPath();
ctx.moveTo(fromX, fromY);
ctx.lineTo(toX, toY);


Caricamento…
Annulla
Salva