[Gui] fix typos

- fix a typo found by codespell
- rename variables to please codespell
This commit is contained in:
Uwe
2022-08-08 14:14:23 +02:00
parent a32e927227
commit 6f546de8f0
2 changed files with 16 additions and 16 deletions

View File

@@ -1764,33 +1764,33 @@ SbVec2f View3DInventorViewer::screenCoordsOfPath(SoPath* path) const
std::vector<SbVec2f> View3DInventorViewer::getGLPolygon(const std::vector<SbVec2s>& 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<SbVec2f> poly;
for (std::vector<SbVec2s>::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);

View File

@@ -103,7 +103,7 @@ public:
virtual std::vector<std::string> extensionGetDisplayModes() const {return std::vector<std::string>();}
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();