import {ShapeControls} from "@client/canvas/containers/elements/shape-controls.mjs";

/**
 * @import Region from "@client/canvas/placeables/region.mjs";
 * @import RegionDocument from "@client/documents/region.mjs";
 * @import RegionLayer from "@client/canvas/layers/regions.mjs";
 */

/**
 * Controls for a Region shape.
 * @extends {ShapeControls<RegionDocument, Region, RegionLayer>}
 */
export default class RegionShapeControls extends ShapeControls {

  /** @inheritDoc */
  _updateDragPreview(event) {
    super._updateDragPreview(event);
    event.interactionData.preview.document.updateShapeConstraints();
  }

  /* -------------------------------------------- */

  /** @override */
  _onClick2(event) {
    if ( this.document.isSingleShape ) this.document.sheet.render({force: true, tab: "shapes"});
    else new foundry.applications.apps.ShapeConfig({shape: this.shape}).render({force: true});
  }
}
