76 Wt::WPointF topLeft = Wt::WPointF(pointData.diamond_out[3].x() + origin.x(), pointData.diamond_out[2].y() + origin.y());
77 Wt::WPointF bottomRight = Wt::WPointF(pointData.diamond_out[1].x() + origin.x(), pointData.diamond_out[0].y() + origin.y());
78 Wt::WRectF diamondBoundingRect = Wt::WRectF(topLeft, bottomRight);
79 if (diamondBoundingRect.contains(trueMouse))
81 sourcePoint = Wt::WPointF((topLeft.x() + bottomRight.x()) / 2, (topLeft.y() + bottomRight.y()) / 2);
95 Wt::WPointF topLeft = Wt::WPointF(pointData.diamond[3].x() + origin.x(), pointData.diamond[2].y() + origin.y());
96 Wt::WPointF bottomRight = Wt::WPointF(pointData.diamond[1].x() + origin.x(), pointData.diamond[0].y() + origin.y());
97 Wt::WRectF diamondBoundingRect = Wt::WRectF(topLeft, bottomRight);
98 if (diamondBoundingRect.contains(trueMouse))
100 sourcePoint = Wt::WPointF((topLeft.x() + bottomRight.x()) / 2, (topLeft.y() + bottomRight.y()) / 2);
114 auto rectTopLeft = pointData.pointRect.topLeft();
115 auto rectBottomRight = pointData.pointRect.bottomRight();
116 Wt::WPointF topLeft = Wt::WPointF(rectTopLeft.x() + origin.x(), rectTopLeft.y() + origin.y());
117 Wt::WPointF bottomRight = Wt::WPointF(rectBottomRight.x() + origin.x(), rectBottomRight.y() + origin.y());
118 Wt::WRectF diamondBoundingRect = Wt::WRectF(topLeft, bottomRight);
119 if (diamondBoundingRect.contains(trueMouse))
121 sourcePoint = Wt::WPointF((topLeft.x() + bottomRight.x()) / 2, (topLeft.y() + bottomRight.y()) / 2);
151 const double defaultOffset = 200;
153 double xDistance = sink.x() - source.x();
155 double horizontalOffset = std::min(defaultOffset, std::abs(xDistance));
157 double verticalOffset = 0;
163 double yDistance = sink.y() - source.y();
165 double vector = yDistance < 0 ? -1.0 : 1.0;
167 verticalOffset = std::min(defaultOffset, std::abs(yDistance)) * vector;
172 horizontalOffset *= ratioX;
174 Wt::WPointF c1(source.x() + horizontalOffset, source.y() + verticalOffset);
175 Wt::WPointF c2(sink.x() - horizontalOffset, sink.y() - verticalOffset);
177 return std::make_pair(c1, c2);
185 p.setWidth(connectionStyle.constructionLineWidth());
186 p.setColor(connectionStyle.constructionColor());
187 p.setStyle(Wt::PenStyle::DashLine);
190 painter->setBrush(Wt::BrushStyle::None);
194 painter->drawPath(cubic);