SObjectItem.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.SObjectItem = void 0;
  4. const lib_1 = require("@persagy-web/draw/lib");
  5. const __1 = require("..");
  6. class SObjectItem extends __1.SGraphItem {
  7. constructor() {
  8. super(...arguments);
  9. this.anchorList = [];
  10. this._width = 64;
  11. this._height = 64;
  12. this.origin = new lib_1.SPoint();
  13. }
  14. get width() {
  15. return this._width;
  16. }
  17. set width(v) {
  18. if (v > 0) {
  19. if (v != this._width) {
  20. let w = this._width;
  21. this._width = v;
  22. this.onResize(new lib_1.SSize(w, this._height), new lib_1.SSize(this._width, this._height));
  23. }
  24. }
  25. }
  26. get height() {
  27. return this._height;
  28. }
  29. set height(v) {
  30. if (v > 0) {
  31. if (v != this._height) {
  32. let h = this._height;
  33. this._height = v;
  34. this.onResize(new lib_1.SSize(this._width, h), new lib_1.SSize(this._width, this._height));
  35. }
  36. }
  37. }
  38. onResize(oldSize, newSize) { }
  39. }
  40. exports.SObjectItem = SObjectItem;