Browse Source

Merge branch 'chonton-master' into develop

codeClimate
Alexander Wunschik 8 years ago
parent
commit
e37759a230
2 changed files with 12 additions and 14 deletions
  1. +10
    -9
      examples/network/nodeStyles/shapes.html
  2. +2
    -5
      lib/network/modules/components/nodes/shapes/Ellipse.js

+ 10
- 9
examples/network/nodeStyles/shapes.html View File

@ -34,15 +34,16 @@
{id: 11, label: 'star', shape: 'star'}, {id: 11, label: 'star', shape: 'star'},
{id: 21, font:{size:30}, label: 'big circle', shape: 'circle' }, {id: 21, font:{size:30}, label: 'big circle', shape: 'circle' },
{id: 22, font:{size:30}, label: 'big ellipse', shape: 'ellipse'}, {id: 22, font:{size:30}, label: 'big ellipse', shape: 'ellipse'},
{id: 23, font:{size:30}, label: 'big database',shape: 'database'},
{id: 24, font:{size:30}, label: 'big box', shape: 'box' },
{id: 25, font:{size:30}, size:40, label: 'big diamond', shape: 'diamond'},
{id: 26, font:{size:30}, size:40, label: 'big dot', shape: 'dot'},
{id: 27, font:{size:30}, size:40, label: 'big square', shape: 'square'},
{id: 28, font:{size:30}, size:40, label: 'big triangle',shape: 'triangle'},
{id: 29, font:{size:30}, size:40, label: 'big triangleDown', shape: 'triangleDown'},
{id: 30, font:{size:30}, label: 'big text', shape: 'text'},
{id: 31, font:{size:30}, size:40, label: 'big star', shape: 'star'}
{id: 23, font:{size:30}, label: 'ellipse with a long label text', shape: 'ellipse'},
{id: 24, font:{size:30}, label: 'big database',shape: 'database'},
{id: 25, font:{size:30}, label: 'big box', shape: 'box' },
{id: 26, font:{size:30}, size:40, label: 'big diamond', shape: 'diamond'},
{id: 27, font:{size:30}, size:40, label: 'big dot', shape: 'dot'},
{id: 28, font:{size:30}, size:40, label: 'big square', shape: 'square'},
{id: 29, font:{size:30}, size:40, label: 'big triangle',shape: 'triangle'},
{id: 30, font:{size:30}, size:40, label: 'big triangleDown', shape: 'triangleDown'},
{id: 31, font:{size:30}, label: 'big text', shape: 'text'},
{id: 32, font:{size:30}, size:40, label: 'big star', shape: 'star'}
]; ];
edges = [ edges = [

+ 2
- 5
lib/network/modules/components/nodes/shapes/Ellipse.js View File

@ -11,11 +11,8 @@ class Ellipse extends NodeBase {
if (this.width === undefined) { if (this.width === undefined) {
var textSize = this.labelModule.getTextSize(ctx, selected); var textSize = this.labelModule.getTextSize(ctx, selected);
this.width = textSize.width * 1.5;
this.height = textSize.height * 2; this.height = textSize.height * 2;
if (this.width < this.height) {
this.width = this.height;
}
this.width = textSize.width + this.height;
this.radius = 0.5*this.width; this.radius = 0.5*this.width;
} }
} }
@ -82,4 +79,4 @@ class Ellipse extends NodeBase {
} }
} }
export default Ellipse;
export default Ellipse;

Loading…
Cancel
Save