| 642 | } |
| 643 | |
| 644 | void DrawPathTool::updateDrawHover() |
| 645 | { |
| 646 | if (!shift_pressed) |
| 647 | angle_helper->getConstrainedCursorPosMap(cur_pos_map, constrained_pos_map); |
| 648 | if (!previous_point_is_curve_point && !left_mouse_down && editingInProgress()) |
| 649 | { |
| 650 | // Show a line to the cursor position as preview |
| 651 | hidePreviewPoints(); |
| 652 | |
| 653 | if (!path_has_preview_point) |
| 654 | { |
| 655 | preview_path->addCoordinate(MapCoord(constrained_pos_map)); |
| 656 | path_has_preview_point = true; |
| 657 | } |
| 658 | preview_path->setCoordinate(preview_path->getCoordinateCount() - 1, MapCoord(constrained_pos_map)); |
| 659 | |
| 660 | updatePreviewPath(); |
| 661 | updateDirtyRect(); // TODO: Possible optimization: mark only the last segment as dirty |
| 662 | } |
| 663 | else if (previous_point_is_curve_point && !left_mouse_down && editingInProgress()) |
| 664 | { |
| 665 | setPreviewPointsPosition(constrained_pos_map, 1); |
| 666 | updateDirtyRect(); |
| 667 | } |
| 668 | } |
| 669 | |
| 670 | void DrawPathTool::createPreviewCurve(MapCoord position, qreal direction) |
| 671 | { |
nothing calls this directly
no test coverage detected