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.

26 lines
492 B

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