- 'use strict';
-
- import ShapeBase from '../util/ShapeBase'
-
- /**
- * A Diamond Node/Cluster shape.
- *
- * @extends ShapeBase
- */
- class Diamond extends ShapeBase {
- /**
- * @param {Object} options
- * @param {Object} body
- * @param {Label} labelModule
- */
- constructor(options, body, labelModule) {
- super(options, body, labelModule)
- }
-
- /**
- *
- * @param {CanvasRenderingContext2D} ctx
- * @param {number} x width
- * @param {number} y height
- * @param {boolean} selected
- * @param {boolean} hover
- * @param {ArrowOptions} values
- */
- draw(ctx, x, y, selected, hover, values) {
- this._drawShape(ctx, 'diamond', 4, x, y, selected, hover, values);
- }
-
- /**
- *
- * @param {CanvasRenderingContext2D} ctx
- * @param {number} angle
- * @returns {number}
- */
- distanceToBorder(ctx, angle) {
- return this._distanceToBorder(ctx,angle);
- }
- }
-
- export default Diamond;
|