vis.js is a dynamic, browser-based visualization library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
451 B

  1. 'use strict';
  2. import ShapeBase from '../util/ShapeBase'
  3. class Square extends ShapeBase {
  4. constructor(options, body, labelModule) {
  5. super(options, body, labelModule)
  6. }
  7. resize() {
  8. this._resizeShape();
  9. }
  10. draw(ctx, x, y, selected, hover) {
  11. this._drawShape(ctx, 'square', 2, x, y, selected, hover);
  12. }
  13. distanceToBorder(ctx, angle) {
  14. this.resize(ctx);
  15. return this._distanceToBorder(angle);
  16. }
  17. }
  18. export default Square;