(times: number)
| 2394 | }) |
| 2395 | |
| 2396 | function rotateX(times: number) { |
| 2397 | editor.select(ids.boxX) |
| 2398 | // Rotate boxX in 90deg steps around its center, equivalent to the |
| 2399 | // original interactive rotation from the top-left rotate handle. |
| 2400 | editor.rotateShapesBy([ids.boxX], (PI / 2) * times) |
| 2401 | |
| 2402 | expect(editor.getShapePageBounds(ids.boxX)!.x).toBeCloseTo(40) |
| 2403 | expect(editor.getShapePageBounds(ids.boxX)!.y).toBeCloseTo(40) |
| 2404 | expect(editor.getShapePageBounds(ids.boxX)!.w).toBeCloseTo(60) |
| 2405 | expect(editor.getShapePageBounds(ids.boxX)!.h).toBeCloseTo(60) |
| 2406 | expect(editor.getShape(ids.boxX)!.rotation).toEqual( |
| 2407 | canonicalizeRotation(((PI / 2) * times) % (PI * 2)) |
| 2408 | ) |
| 2409 | } |
| 2410 | |
| 2411 | it('should work for 90deg', () => { |
| 2412 | rotateX(1) |
no test coverage detected
searching dependent graphs…