From 50d614f925ef15df0d5ad0fc8ddc136bf612a3eb Mon Sep 17 00:00:00 2001 From: WandererFan Date: Wed, 4 Jan 2017 12:39:23 -0500 Subject: [PATCH] Fix non-rotation of QGIDecorations with QGIViewPart --- src/Mod/TechDraw/Gui/QGIView.cpp | 1 + src/Mod/TechDraw/Gui/QGIViewPart.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/TechDraw/Gui/QGIView.cpp b/src/Mod/TechDraw/Gui/QGIView.cpp index 011c7043c6..336c4c913e 100644 --- a/src/Mod/TechDraw/Gui/QGIView.cpp +++ b/src/Mod/TechDraw/Gui/QGIView.cpp @@ -270,6 +270,7 @@ void QGIView::updateView(bool update) //NOTE: QPainterPaths have to be rotated individually. This transform handles Rotation for everything else. //Scale is handled in GeometryObject for DVP & descendents //Objects not descended from DVP must setScale for themselves + //note that setTransform(,,rotation,,) is not the same as setRotation!!! double rot = getViewObject()->Rotation.getValue(); QPointF centre = boundingRect().center(); setTransform(QTransform().translate(centre.x(), centre.y()).rotate(-rot).translate(-centre.x(), -centre.y())); diff --git a/src/Mod/TechDraw/Gui/QGIViewPart.cpp b/src/Mod/TechDraw/Gui/QGIViewPart.cpp index b02301fa5c..d0e6bba10b 100644 --- a/src/Mod/TechDraw/Gui/QGIViewPart.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewPart.cpp @@ -314,6 +314,7 @@ void QGIViewPart::updateView(bool update) viewPart->isTouched() || viewPart->Source.isTouched() || viewPart->Direction.isTouched() || + viewPart->Rotation.isTouched() || viewPart->Scale.isTouched() || viewPart->HardHidden.isTouched() || viewPart->SmoothVisible.isTouched() || @@ -345,7 +346,8 @@ void QGIViewPart::updateView(bool update) void QGIViewPart::draw() { drawViewPart(); drawMatting(); - drawBorder(); +// drawBorder(); + QGIView::draw(); } void QGIViewPart::drawViewPart() @@ -601,6 +603,7 @@ void QGIViewPart::drawSectionLine(TechDraw::DrawViewSection* viewSection, bool b sectionLine->setWidth(Rez::guiX(viewPart->LineWidth.getValue())); //TODO: add fudge to make sectionLine thinner than reg lines? sectionLine->setFont(m_font,Rez::guiX(6.0)); sectionLine->setZValue(ZVALUE::SECTIONLINE); + sectionLine->setRotation(- viewPart->Rotation.getValue()); sectionLine->draw(); } } @@ -630,6 +633,7 @@ void QGIViewPart::drawCenterLines(bool b) centerLine->setBounds(-xVal,-yVal,xVal,yVal); //centerLine->setWidth(viewPart->LineWidth.getValue()); centerLine->setZValue(ZVALUE::SECTIONLINE); + centerLine->setRotation(- viewPart->Rotation.getValue()); centerLine->draw(); } if (vert) { @@ -642,6 +646,7 @@ void QGIViewPart::drawCenterLines(bool b) centerLine->setBounds(-xVal,-yVal,xVal,yVal); //centerLine->setWidth(viewPart->LineWidth.getValue()); centerLine->setZValue(ZVALUE::SECTIONLINE); + centerLine->setRotation(- viewPart->Rotation.getValue()); centerLine->draw(); } }