| 564 | } |
| 565 | |
| 566 | void UBGraphicsRuler::StartLine(const QPointF& scenePos, qreal width) |
| 567 | { |
| 568 | Q_UNUSED(width); |
| 569 | |
| 570 | QPointF itemPos = mapFromScene(scenePos); |
| 571 | |
| 572 | mStrokeWidth = UBDrawingController::drawingController()->currentToolWidth(); |
| 573 | |
| 574 | qreal y; |
| 575 | |
| 576 | if (itemPos.y() > rect().y() + rect().height() / 2) |
| 577 | { |
| 578 | drawLineDirection = 0; |
| 579 | y = rect().y() + rect().height() + mStrokeWidth / 2; |
| 580 | } |
| 581 | else |
| 582 | { |
| 583 | drawLineDirection = 1; |
| 584 | y = rect().y() - mStrokeWidth /2; |
| 585 | } |
| 586 | |
| 587 | itemPos.setY(y); |
| 588 | itemPos = mapToScene(itemPos); |
| 589 | |
| 590 | scene()->moveTo(itemPos); |
| 591 | scene()->drawLineTo(itemPos, mStrokeWidth, true); |
| 592 | } |
| 593 | |
| 594 | void UBGraphicsRuler::DrawLine(const QPointF& scenePos, qreal width) |
| 595 | { |
no test coverage detected