diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index b3e5166e49..15c46f7282 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -1764,33 +1764,33 @@ SbVec2f View3DInventorViewer::screenCoordsOfPath(SoPath* path) const std::vector View3DInventorViewer::getGLPolygon(const std::vector& pnts) const { - const SbViewportRegion& vp = this->getSoRenderManager()->getViewportRegion(); - const SbVec2s& sz = vp.getWindowSize(); - short w,h; - sz.getValue(w,h); - const SbVec2s& sp = vp.getViewportSizePixels(); - const SbVec2s& op = vp.getViewportOriginPixels(); - const SbVec2f& siz = vp.getViewportSize(); + const SbViewportRegion &vp = this->getSoRenderManager()->getViewportRegion(); + const SbVec2s &winSize = vp.getWindowSize(); + short w, h; + winSize.getValue(w, h); + const SbVec2s &sp = vp.getViewportSizePixels(); + const SbVec2s &op = vp.getViewportOriginPixels(); + const SbVec2f &vpSize = vp.getViewportSize(); float dX, dY; - siz.getValue(dX, dY); + vpSize.getValue(dX, dY); float fRatio = vp.getViewportAspectRatio(); std::vector poly; for (std::vector::const_iterator it = pnts.begin(); it != pnts.end(); ++it) { SbVec2s loc = *it - op; - SbVec2f pos((float)loc[0]/(float)sp[0], (float)loc[1]/(float)sp[1]); - float pX,pY; - pos.getValue(pX,pY); + SbVec2f pos((float)loc[0] / (float)sp[0], (float)loc[1] / (float)sp[1]); + float pX, pY; + pos.getValue(pX, pY); // now calculate the real points respecting aspect ratio information // if (fRatio > 1.0f) { - pX = (pX - 0.5f*dX) * fRatio + 0.5f*dX; - pos.setValue(pX,pY); + pX = (pX - 0.5f * dX) * fRatio + 0.5f * dX; + pos.setValue(pX, pY); } else if (fRatio < 1.0f) { - pY = (pY - 0.5f*dY) / fRatio + 0.5f*dY; - pos.setValue(pX,pY); + pY = (pY - 0.5f * dY) / fRatio + 0.5f * dY; + pos.setValue(pX, pY); } poly.push_back(pos); diff --git a/src/Gui/ViewProviderExtension.h b/src/Gui/ViewProviderExtension.h index f09b1feba3..9f2d38989a 100644 --- a/src/Gui/ViewProviderExtension.h +++ b/src/Gui/ViewProviderExtension.h @@ -103,7 +103,7 @@ public: virtual std::vector extensionGetDisplayModes() const {return std::vector();} virtual void extensionSetupContextMenu(QMenu*, QObject*, const char*) {} - //update data of extended opject + // update data of extended object virtual void extensionUpdateData(const App::Property*); virtual PyObject* getExtensionPyObject();