MCPcopy Create free account
hub / github.com/KDE/okular / strokeDistance

Function strokeDistance

core/annotations.cpp:93–96  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

91 * "Inside" of the drawn line, the distance is 0 anyway.
92 */
93static double strokeDistance(double distance, double penWidth)
94{
95 return fmax(distance - pow(penWidth, 2), 0);
96}
97
98// BEGIN AnnotationUtils implementation
99Annotation *AnnotationUtils::createAnnotation(const QDomElement &annElement)

Callers 1

distanceSqrMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected