MCPcopy Create free account
hub / github.com/OpenBoard-org/OpenBoard / StartLine

Method StartLine

src/tools/UBGraphicsRuler.cpp:566–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564}
565
566void 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
594void UBGraphicsRuler::DrawLine(const QPointF& scenePos, qreal width)
595{

Callers 1

inputDevicePressMethod · 0.45

Calls 4

currentToolWidthMethod · 0.80
heightMethod · 0.45
moveToMethod · 0.45
drawLineToMethod · 0.45

Tested by

no test coverage detected