(objectColor, moveX, moveY)
| 73 | |
| 74 | // Tests moving the annotation label |
| 75 | function testAnnotationMoveLabel(objectColor, moveX, moveY) { |
| 76 | var bboxAfter; |
| 77 | // Get where the text box (label) is before dragging it |
| 78 | var bboxBefore = getSVGElemScreenBBox( |
| 79 | domainRefComponents.findAROByColor(objectColor, undefined, 'rect') |
| 80 | ); |
| 81 | // we have to use drag to move annotations for some reason |
| 82 | var optLabelDrag = { |
| 83 | pos0: dragPos0(bboxBefore) |
| 84 | }; |
| 85 | optLabelDrag.dpos = [moveX, moveY]; |
| 86 | // console.log('optLabelDrag', optLabelDrag); |
| 87 | // drag the label, this will make the arrow rotate around the arrowhead |
| 88 | return (new Promise(function(resolve) { |
| 89 | drag(optLabelDrag); resolve(); |
| 90 | })) |
| 91 | .then(delay(DELAY_TIME)) |
| 92 | .then(function() { |
| 93 | // then check it's position |
| 94 | bboxAfter = getSVGElemScreenBBox( |
| 95 | domainRefComponents.findAROByColor(objectColor, undefined, 'rect') |
| 96 | ); |
| 97 | checkBBox(bboxBefore, bboxAfter, moveX, moveY); |
| 98 | }) |
| 99 | .then(delay(DELAY_TIME)); |
| 100 | } |
| 101 | |
| 102 | // Tests moving the whole annotation |
| 103 | function testAnnotationMoveWhole(objectColor, arrowColor, moveX, moveY, corner) { |
no test coverage detected
searching dependent graphs…