Regions.js 800 B

1234567891011121314151617181920212223242526272829303132333435
  1. const AtOutliner = require("./AtOutliner");
  2. const { I } = inject();
  3. module.exports = {
  4. unselectWithHotkey() {
  5. // wait is necessary for "Select region after creation" cases because
  6. // there's delay between region creation and ability to unselect a region
  7. I.waitTicks(2);
  8. I.pressKey(["u"]);
  9. AtOutliner.dontSeeSelectedRegion();
  10. },
  11. async getBBoxByRegionIdx(idx) {
  12. return await I.executeScript(
  13. ({ idx }) => {
  14. return window.Htx.annotationStore.selected.regionStore.regions[idx].bboxCoordsCanvas;
  15. },
  16. { idx },
  17. );
  18. },
  19. undoLastActionWithHotkey() {
  20. I.pressKey(["CommandOrControl", "z"]);
  21. },
  22. redoLastAction() {
  23. I.pressKey(["CommandOrControl", "Shift", "z"]);
  24. },
  25. //Image tools
  26. selectMoveTool() {
  27. I.pressKey("v");
  28. },
  29. };