Browse Source

Fix #2922: bold label for selected ShapeBase classes. (#2924)

gemini
wimrijnders 7 years ago
committed by yotamberk
parent
commit
f67d16c963
7 changed files with 3 additions and 26 deletions
  1. +0
    -4
      lib/network/modules/components/nodes/shapes/Diamond.js
  2. +0
    -4
      lib/network/modules/components/nodes/shapes/Dot.js
  3. +0
    -4
      lib/network/modules/components/nodes/shapes/Square.js
  4. +0
    -4
      lib/network/modules/components/nodes/shapes/Star.js
  5. +0
    -4
      lib/network/modules/components/nodes/shapes/Triangle.js
  6. +0
    -4
      lib/network/modules/components/nodes/shapes/TriangleDown.js
  7. +3
    -2
      lib/network/modules/components/nodes/util/ShapeBase.js

+ 0
- 4
lib/network/modules/components/nodes/shapes/Diamond.js View File

@ -7,10 +7,6 @@ class Diamond extends ShapeBase {
super(options, body, labelModule)
}
resize(ctx, selected = this.selected, hover = this.hover, values) {
this._resizeShape(selected, hover, values);
}
draw(ctx, x, y, selected, hover, values) {
this._drawShape(ctx, 'diamond', 4, x, y, selected, hover, values);
}

+ 0
- 4
lib/network/modules/components/nodes/shapes/Dot.js View File

@ -7,10 +7,6 @@ class Dot extends ShapeBase {
super(options, body, labelModule)
}
resize(ctx, selected = this.selected, hover = this.hover, values) {
this._resizeShape(selected, hover, values);
}
draw(ctx, x, y, selected, hover, values) {
this._drawShape(ctx, 'circle', 2, x, y, selected, hover, values);
}

+ 0
- 4
lib/network/modules/components/nodes/shapes/Square.js View File

@ -7,10 +7,6 @@ class Square extends ShapeBase {
super(options, body, labelModule)
}
resize() {
this._resizeShape();
}
draw(ctx, x, y, selected, hover, values) {
this._drawShape(ctx, 'square', 2, x, y, selected, hover, values);
}

+ 0
- 4
lib/network/modules/components/nodes/shapes/Star.js View File

@ -7,10 +7,6 @@ class Star extends ShapeBase {
super(options, body, labelModule)
}
resize(ctx, selected, hover, values) {
this._resizeShape(selected, hover, values);
}
draw(ctx, x, y, selected, hover, values) {
this._drawShape(ctx, 'star', 4, x, y, selected, hover, values);
}

+ 0
- 4
lib/network/modules/components/nodes/shapes/Triangle.js View File

@ -7,10 +7,6 @@ class Triangle extends ShapeBase {
super(options, body, labelModule)
}
resize(ctx) {
this._resizeShape();
}
draw(ctx, x, y, selected, hover, values) {
this._drawShape(ctx, 'triangle', 3, x, y, selected, hover, values);
}

+ 0
- 4
lib/network/modules/components/nodes/shapes/TriangleDown.js View File

@ -7,10 +7,6 @@ class TriangleDown extends ShapeBase {
super(options, body, labelModule)
}
resize(ctx) {
this._resizeShape();
}
draw(ctx, x, y, selected, hover, values) {
this._drawShape(ctx, 'triangleDown', 3, x, y, selected, hover, values);
}

+ 3
- 2
lib/network/modules/components/nodes/util/ShapeBase.js View File

@ -5,8 +5,9 @@ class ShapeBase extends NodeBase {
super(options, body, labelModule)
}
_resizeShape(selected = this.selected, hover = this.hover, values = { size: this.options.size }) {
resize(ctx, selected = this.selected, hover = this.hover, values = { size: this.options.size }) {
if (this.needsRefresh(selected, hover)) {
this.labelModule.getTextSize(ctx, selected, hover);
var size = 2 * values.size;
this.width = size;
this.height = size;
@ -15,7 +16,7 @@ class ShapeBase extends NodeBase {
}
_drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover, values) {
this._resizeShape(selected, hover, values);
this.resize(ctx, selected, hover, values);
this.left = x - this.width / 2;
this.top = y - this.height / 2;

Loading…
Cancel
Save