mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Element editor : add handler for modifie primitives
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4058 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -155,6 +155,17 @@ QVector<QPointF> QetGraphicsHandlerUtility::pointsForRect(const QRectF &rect)
|
||||
return vector;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QetGraphicsHandlerUtility::pointsForLine
|
||||
* The point that define a line in a QVector.
|
||||
* there is two points.
|
||||
* @param line
|
||||
* @return
|
||||
*/
|
||||
QVector<QPointF> QetGraphicsHandlerUtility::pointsForLine(const QLineF &line) {
|
||||
return (QVector<QPointF> {line.p1(), line.p2()});
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QetGraphicsHandlerUtility::rectForPosAtIndex
|
||||
* Return a rectangle after modification of the point '@pos' at index '@index' of original rectangle '@old_rect'.
|
||||
@@ -180,3 +191,17 @@ QRectF QetGraphicsHandlerUtility::rectForPosAtIndex(const QRectF &old_rect, cons
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QetGraphicsHandlerUtility::lineForPosAtIndex
|
||||
* Return a line after modification of @pos at index @index of @old_line.
|
||||
* @param old_line
|
||||
* @param pos
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
QLineF QetGraphicsHandlerUtility::lineForPosAtIndex(const QLineF &old_line, const QPointF &pos, int index) {
|
||||
QLineF line = old_line;
|
||||
index == 0 ? line.setP1(pos) : line.setP2(pos);
|
||||
return line;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user