mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
cross ref item : show the master comment at the bottom of cross
element : improve the function to sort an element list qet graphics item : add a bool to disable the snap to grid (used for cross ref item, to be exactly at the bottom of element) git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2948 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -26,7 +26,8 @@
|
||||
QetGraphicsItem::QetGraphicsItem(QGraphicsItem *parent):
|
||||
QGraphicsObject(parent),
|
||||
is_movable_(true),
|
||||
first_move_(true)
|
||||
first_move_(true),
|
||||
snap_to_grid_(true)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -48,7 +49,7 @@ Diagram* QetGraphicsItem::diagram() const{
|
||||
*/
|
||||
void QetGraphicsItem::setPos(const QPointF &p) {
|
||||
if (p == pos() || !is_movable_) return;
|
||||
if (scene()) {
|
||||
if (scene() && snap_to_grid_) {
|
||||
// arrondit l'abscisse a 10 px pres
|
||||
int p_x = qRound(p.x() / (Diagram::xGrid * 1.0)) * Diagram::xGrid;
|
||||
// arrondit l'ordonnee a 10 px pres
|
||||
|
||||
Reference in New Issue
Block a user