X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Frs_dimension.cpp;h=7537841ecf34b9df975f79aba660ea0c2b818c80;hb=20cce16e98fc9b052c5862efa6394a285971e846;hp=01097c6c6f443ce8ca1a77b21e1815ed81604015;hpb=89e127aa3dbd74d3158e6dbe0ca1703420c04395;p=architektonas diff --git a/src/base/rs_dimension.cpp b/src/base/rs_dimension.cpp index 01097c6..7537841 100644 --- a/src/base/rs_dimension.cpp +++ b/src/base/rs_dimension.cpp @@ -3,7 +3,9 @@ // Part of the Architektonas Project // Originally part of QCad Community Edition by Andrew Mustun // Extensively rewritten and refactored by James L. Hammons -// (C) 2010 Underground Software +// Portions copyright (C) 2001-2003 RibbonSoft +// Copyright (C) 2010 Underground Software +// See the README and GPLv2 files for licensing and warranty information // // JLH = James L. Hammons // @@ -93,17 +95,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 +172,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 +190,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 +201,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); }