MCPcopy Create free account
hub / github.com/MyGUI/mygui / reset

Method reset

MyGUIEngine/src/msdfgen/core/edge-selectors.cpp:12–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10TrueDistanceSelector::EdgeCache::EdgeCache() : absDistance(0) { }
11
12void TrueDistanceSelector::reset(const Point2 &p) {
13 double delta = DISTANCE_DELTA_FACTOR*(p-this->p).length();
14 // Since minDistance.distance is initialized to -DBL_MAX, at first glance this seems like it could make it underflow to -infinity, but in practice delta would have to be extremely high for this to happen (above 9e291)
15 minDistance.distance += nonZeroSign(minDistance.distance)*delta;
16 this->p = p;
17}
18
19void TrueDistanceSelector::addEdge(EdgeCache &cache, const EdgeSegment *prevEdge, const EdgeSegment *edge, const EdgeSegment *nextEdge) {
20 double delta = DISTANCE_DELTA_FACTOR*(p-cache.point).length();

Callers 2

distanceMethod · 0.45
oneShotDistanceMethod · 0.45

Calls 3

nonZeroSignFunction · 0.85
resetFunction · 0.85
lengthMethod · 0.45

Tested by

no test coverage detected