Fix ProjectionGroupItem spacing

This commit is contained in:
WandererFan
2016-08-27 20:52:18 -04:00
parent a1b87d5176
commit e264a16b62
9 changed files with 637 additions and 625 deletions

View File

@@ -139,7 +139,7 @@ QVariant QGIProjGroup::itemChange(GraphicsItemChange change, const QVariant &val
}
}
}
return QGIView::itemChange(change, value);
return QGIViewCollection::itemChange(change, value);
}
@@ -183,7 +183,7 @@ void QGIProjGroup::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.X = %f",
getViewObject()->getNameInDocument(), x());
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Y = %f",
getViewObject()->getNameInDocument(), getY());// inverts Y
getViewObject()->getNameInDocument(), getY());// inverts Y
Gui::Command::commitCommand();
//Gui::Command::updateActive();
}
@@ -224,4 +224,3 @@ void QGIProjGroup::drawBorder()
//QGIProjGroup does not have a border!
// Base::Console().Message("TRACE - QGIProjGroup::drawBorder - doing nothing!!\n");
}

View File

@@ -100,9 +100,9 @@ void QGIView::alignTo(QGraphicsItem*item, const QString &alignment)
QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
{
QPointF newPos(0.0,0.0);
if(change == ItemPositionChange && scene()) {
QPointF newPos = value.toPointF();
newPos = value.toPointF();
if(locked){
newPos.setX(pos().x());
newPos.setY(pos().y());
@@ -163,6 +163,7 @@ void QGIView::mouseMoveEvent(QGraphicsSceneMouseEvent * event)
void QGIView::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
{
if(!locked && isSelected()) {
getViewObject()->setMouseMove(true);
if (!isInnerView()) {
double tempX = x(),
tempY = getY();
@@ -172,6 +173,7 @@ void QGIView::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
getViewObject()->X.setValue(x());
getViewObject()->Y.setValue(getYInClip(y()));
}
getViewObject()->setMouseMove(false);
}
QGraphicsItem::mouseReleaseEvent(event);
}

View File

@@ -58,25 +58,16 @@ QGIViewCollection::QGIViewCollection()
QVariant QGIViewCollection::itemChange(GraphicsItemChange change, const QVariant &value)
{
return QGraphicsItemGroup::itemChange(change, value);
return QGIView::itemChange(change, value);
}
void QGIViewCollection::mouseReleaseEvent(QGraphicsSceneMouseEvent * event)
{
if(scene() && this == scene()->mouseGrabberItem()) {
Gui::Command::openCommand("Drag View Collection");
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.X = %f",
getViewObject()->getNameInDocument(), x());
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Y = %f",
getViewObject()->getNameInDocument(), getY());
Gui::Command::commitCommand();
//Gui::Command::updateActive();
}
QGraphicsItem::mouseReleaseEvent(event);
//TODO: should MouseMove logic go here instead of QGIView?
QGIView::mouseReleaseEvent(event);
}
void QGIViewCollection::updateView(bool update)
{
return QGIView::updateView(update);
}

View File

@@ -102,18 +102,11 @@ void TaskProjGroup::viewToggled(bool toggle)
QString viewName = sender()->objectName();
int index = viewName.mid(7).toInt();
const char *viewNameCStr = viewChkIndexToCStr(index);
//Gui::Command::openCommand("Toggle orthographic view"); //TODO: Is this for undo?
if ( toggle && !multiView->hasProjection( viewNameCStr ) ) {
multiView->addProjection( viewNameCStr );
} else if ( !toggle && multiView->hasProjection( viewNameCStr ) ) {
multiView->removeProjection( viewNameCStr );
}
/// Called to notify the GUI that the scale has changed
Gui::Command::commitCommand();
Gui::Command::updateActive();
}
void TaskProjGroup::rotateButtonClicked(void)