mirror of https://github.com/Chlumsky/msdfgen.git
Removed SignedDistance::INFINITE constant
This commit is contained in:
parent
64a91eec3c
commit
1b2bee7d8e
|
|
@ -2,12 +2,11 @@
|
|||
#include "SignedDistance.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cfloat>
|
||||
|
||||
namespace msdfgen {
|
||||
|
||||
const SignedDistance SignedDistance::INFINITE(-1e240, 1);
|
||||
|
||||
SignedDistance::SignedDistance() : distance(-1e240), dot(1) { }
|
||||
SignedDistance::SignedDistance() : distance(-DBL_MAX), dot(1) { }
|
||||
|
||||
SignedDistance::SignedDistance(double dist, double d) : distance(dist), dot(d) { }
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ namespace msdfgen {
|
|||
class SignedDistance {
|
||||
|
||||
public:
|
||||
static const SignedDistance INFINITE;
|
||||
|
||||
double distance;
|
||||
double dot;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
|
||||
#include "contour-combiners.h"
|
||||
|
||||
#include <cfloat>
|
||||
#include "arithmetics.hpp"
|
||||
|
||||
namespace msdfgen {
|
||||
|
||||
static void initDistance(double &distance) {
|
||||
distance = SignedDistance::INFINITE.distance;
|
||||
distance = -DBL_MAX;
|
||||
}
|
||||
|
||||
static void initDistance(MultiDistance &distance) {
|
||||
distance.r = SignedDistance::INFINITE.distance;
|
||||
distance.g = SignedDistance::INFINITE.distance;
|
||||
distance.b = SignedDistance::INFINITE.distance;
|
||||
distance.r = -DBL_MAX;
|
||||
distance.g = -DBL_MAX;
|
||||
distance.b = -DBL_MAX;
|
||||
}
|
||||
|
||||
static double resolveDistance(double distance) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include <cstdlib>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <cfloat>
|
||||
#include <queue>
|
||||
#include "arithmetics.hpp"
|
||||
|
||||
|
|
@ -244,7 +245,7 @@ static double edgeToEdgeDistance(const EdgeSegment &a, const EdgeSegment &b, int
|
|||
}
|
||||
|
||||
static double splineToSplineDistance(EdgeSegment * const *edgeSegments, int aStart, int aEnd, int bStart, int bEnd, int precision) {
|
||||
double minDistance = fabs(SignedDistance::INFINITE.distance);
|
||||
double minDistance = DBL_MAX;
|
||||
for (int ai = aStart; ai < aEnd; ++ai)
|
||||
for (int bi = bStart; bi < bEnd && minDistance; ++bi) {
|
||||
double d = edgeToEdgeDistance(*edgeSegments[ai], *edgeSegments[bi], precision);
|
||||
|
|
|
|||
Loading…
Reference in New Issue