+ if (aFlyOutAttr->isInitialized()) {
+ std::shared_ptr<GeomAPI_XY> aFlyoutPoint = aFlyOutAttr->pnt()->xy();
+ std::shared_ptr<GeomAPI_XY> anInterXY = anInter->xy();
+ std::shared_ptr<GeomAPI_XY> aDirIF = aFlyoutPoint->decreased(anInterXY);
+ std::shared_ptr<GeomAPI_XY> aDirIA = aPointA->xy()->decreased(anInterXY);
+ std::shared_ptr<GeomAPI_XY> aDirIB = aPointB->xy()->decreased(anInterXY);
+ double aSign = aDirIA->cross(aDirIB);
+ aSign /= fabs(aSign);
+ if (anAngleType == (int)SketcherPrs_Tools::ANGLE_BACKWARD)
+ aSign *= -1.0;
+
+ double cross1 = aSign * aDirIA->cross(aDirIF);
+ if (cross1 < -tolerance)
+ boolean(ANGLE_REVERSED_SECOND_LINE_ID())->setValue(!isReversed2);
+ double cross2 = aSign * aDirIF->cross(aDirIB);
+ if (cross2 < -tolerance)
+ boolean(ANGLE_REVERSED_FIRST_LINE_ID())->setValue(!isReversed1);
+
+ // the direction is reversed only once
+ if ((cross1 + tolerance) * (cross2 + tolerance) < 0.0) {
+ if (anAngleType == (int)SketcherPrs_Tools::ANGLE_BACKWARD) {
+ convertAngle(real(ANGLE_VALUE_ID()), (int)SketcherPrs_Tools::ANGLE_BACKWARD,
+ (int)SketcherPrs_Tools::ANGLE_DIRECT);
+ }
+ convertAngle(real(ANGLE_VALUE_ID()), (int)SketcherPrs_Tools::ANGLE_DIRECT,
+ (int)SketcherPrs_Tools::ANGLE_COMPLEMENTARY);
+ if (anAngleType == (int)SketcherPrs_Tools::ANGLE_BACKWARD) {
+ convertAngle(real(ANGLE_VALUE_ID()), (int)SketcherPrs_Tools::ANGLE_DIRECT,
+ (int)SketcherPrs_Tools::ANGLE_BACKWARD);
+ }
+ }