Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit e8fd99b

Browse files
Gondragosnick-skriabinmakseq
authored
DEV-1155: Rotation behavior (#397)
* [fix] Fix transformer behavior - moved transformer background out of ImageTransformer and stop using Portal component - reworked of LSTransformer and drag bounding functions to make dragging of multiple regions synchronous - removed influence of outter transformer background on transformer area size and its recalculation triggering - stopped listening history by transformer 'cause it isn't nessecary anymore * [fix] Prevent skewing during transformation * [fix] Fix selected area position while zooming * [fix] Fix wrong units of rotation angle in transformer bound box function * [ext] Add tests for transformer and dragging of image regions * Fix tests * refactor: DEV-1155: Refactor of condition for skipping nodes attaching * test: DEV-1155: Fix drawing of polygon in multiple region transforming test * fix: DEV-1155: Fix dragging polygon regions * Fix: DEV-1155: Fix rotated region stucking at corners Co-authored-by: Nick Skriabin <[email protected]> Co-authored-by: Max Tkachenko <[email protected]>
1 parent 92541fd commit e8fd99b

File tree

12 files changed

+1425
-220
lines changed

12 files changed

+1425
-220
lines changed

e2e/fragments/AtImageView.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ module.exports = {
109109
return count;
110110
},
111111

112+
async isTransformerExist() {
113+
const isTransformerExist = await I.executeAsyncScript(Helpers.isTransformerExist);
114+
115+
return isTransformerExist;
116+
},
117+
118+
async isRotaterExist() {
119+
const isRotaterExist = await I.executeAsyncScript(Helpers.isRotaterExist);
120+
121+
return isRotaterExist;
122+
},
123+
112124
/**
113125
* Mousedown - mousemove - mouseup drawing on the ImageView. Works in couple of lookForStage.
114126
* @example

e2e/tests/helpers.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,20 @@ const countKonvaShapes = async done => {
369369
done(count);
370370
};
371371

372+
const isTransformerExist = async done => {
373+
const stage = window.Konva.stages[0];
374+
const achors = stage.find("._anchor").filter(shape => shape.getAttr("visible") !== false);
375+
376+
done(!!achors.length);
377+
};
378+
379+
const isRotaterExist = async done => {
380+
const stage = window.Konva.stages[0];
381+
const achors = stage.find(".rotater").filter(shape => shape.getAttr("visible") !== false);
382+
383+
done(!!achors.length);
384+
};
385+
372386
const switchRegionTreeView = (viewName, done) => {
373387
Htx.annotationStore.selected.regionStore.setView(viewName);
374388
done();
@@ -518,6 +532,8 @@ module.exports = {
518532
setZoom,
519533
whereIsPixel,
520534
countKonvaShapes,
535+
isTransformerExist,
536+
isRotaterExist,
521537
switchRegionTreeView,
522538
hasSelectedRegion,
523539

0 commit comments

Comments
 (0)