X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Frs_dimension.cpp;h=91c49297d59160de3d6e45e41e3164255cfc6a63;hb=5374cdbb127a1bced9a65abeb30b1ef4eb5e35a7;hp=01097c6c6f443ce8ca1a77b21e1815ed81604015;hpb=89e127aa3dbd74d3158e6dbe0ca1703420c04395;p=architektonas diff --git a/src/base/rs_dimension.cpp b/src/base/rs_dimension.cpp index 01097c6..91c4929 100644 --- a/src/base/rs_dimension.cpp +++ b/src/base/rs_dimension.cpp @@ -93,17 +93,17 @@ void RS_Dimension::setLabel(const QString & l) void RS_Dimension::updateCreateDimensionLine(const Vector & p1, const Vector & p2, bool arrow1, bool arrow2, bool forceAutoText) { +#if 0 +printf("RS_Dimension::updateCreateDimensionLine()...\n"); +#endif // text height (DIMTXT) double dimtxt = getTextHeight(); // text distance to line (DIMGAP) double dimgap = getDimensionLineGap(); - // length of dimension line: double distance = p1.distanceTo(p2); - // do we have to put the arrows outside of the line? - bool outsideArrows = (distancesetLayer(NULL); addEntity(dimensionLine); - if (outsideArrows == false) + if (!outsideArrows) { arrowAngle1 = dimensionLine->getAngle2(); arrowAngle2 = dimensionLine->getAngle1(); @@ -170,19 +170,14 @@ void RS_Dimension::updateCreateDimensionLine(const Vector & p1, else { textPos = dimensionLine->getMiddlepoint(); - Vector distV; // rotate text so it's readable from the bottom or right (ISO) // quadrant 1 & 4 if (corrected) - { distV.setPolar(dimgap + dimtxt / 2.0, dimAngle1 - M_PI / 2.0); - } else - { distV.setPolar(dimgap + dimtxt / 2.0, dimAngle1 + M_PI / 2.0); - } // move text away from dimension line: textPos += distV; @@ -193,6 +188,9 @@ void RS_Dimension::updateCreateDimensionLine(const Vector & p1, textData = RS_TextData(textPos, dimtxt, 30.0, RS2::VAlignMiddle, RS2::HAlignCenter, RS2::LeftToRight, RS2::Exact, 1.0, getLabel(), "standard", textAngle); +#if 0 +printf("--> %s\n", getLabel().toAscii().data()); +#endif RS_Text * text = new RS_Text(this, textData); @@ -201,8 +199,7 @@ void RS_Dimension::updateCreateDimensionLine(const Vector & p1, if (text->getUsedTextWidth() > distance) { - distH.setPolar(text->getUsedTextWidth() / 2.0 - + distance / 2.0 + dimgap, textAngle); + distH.setPolar(text->getUsedTextWidth() / 2.0 + distance / 2.0 + dimgap, textAngle); text->move(distH); }