* Given the squared @p distance from the idealized 0-width line and a pen width @p penWidth, * (not squared!), returns the final distance * * @warning The returned distance is not exact: * We calculate an (exact) squared distance to the ideal (centered) line, and then subtract * the squared width of the pen: * a^2 - b^2 where a = "distance from idealized 0-width line" b = "pen width" * For
| 91 | * "Inside" of the drawn line, the distance is 0 anyway. |
| 92 | */ |
| 93 | static double strokeDistance(double distance, double penWidth) |
| 94 | { |
| 95 | return fmax(distance - pow(penWidth, 2), 0); |
| 96 | } |
| 97 | |
| 98 | // BEGIN AnnotationUtils implementation |
| 99 | Annotation *AnnotationUtils::createAnnotation(const QDomElement &annElement) |