* @brief Computes the unit direction between two pixel-space points; returns false for * degenerate (near zero-length) segments. */
| 61 | * degenerate (near zero-length) segments. |
| 62 | */ |
| 63 | static bool unitDir(const QPointF& from, const QPointF& to, QPointF& dir) |
| 64 | { |
| 65 | const double dx = to.x() - from.x(); |
| 66 | const double dy = to.y() - from.y(); |
| 67 | const double len = std::sqrt(dx * dx + dy * dy); |
| 68 | if (!(len > 1e-6)) |
| 69 | return false; |
| 70 | |
| 71 | dir = QPointF(dx / len, dy / len); |
| 72 | return true; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * @brief Arc-segment count for the round join between two unit segment directions: the exterior |