mirror of https://github.com/Chlumsky/msdfgen.git
Fixed #180
This commit is contained in:
parent
0286aeb6eb
commit
26143a3e9f
|
|
@ -162,6 +162,7 @@ void Shape::orientContours() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!intersections.empty()) {
|
||||||
qsort(&intersections[0], intersections.size(), sizeof(Intersection), &Intersection::compare);
|
qsort(&intersections[0], intersections.size(), sizeof(Intersection), &Intersection::compare);
|
||||||
// Disqualify multiple intersections
|
// Disqualify multiple intersections
|
||||||
for (int j = 1; j < (int) intersections.size(); ++j)
|
for (int j = 1; j < (int) intersections.size(); ++j)
|
||||||
|
|
@ -174,6 +175,7 @@ void Shape::orientContours() {
|
||||||
intersections.clear();
|
intersections.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Reverse contours that have the opposite orientation
|
// Reverse contours that have the opposite orientation
|
||||||
for (int i = 0; i < (int) contours.size(); ++i)
|
for (int i = 0; i < (int) contours.size(); ++i)
|
||||||
if (orientations[i] < 0)
|
if (orientations[i] < 0)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
|
|
||||||
#include "ShapeDistanceFinder.h"
|
#include "ShapeDistanceFinder.h"
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
namespace msdfgen {
|
namespace msdfgen {
|
||||||
|
|
||||||
template <class ContourCombiner>
|
template <class ContourCombiner>
|
||||||
|
|
@ -9,7 +11,11 @@ ShapeDistanceFinder<ContourCombiner>::ShapeDistanceFinder(const Shape &shape) :
|
||||||
template <class ContourCombiner>
|
template <class ContourCombiner>
|
||||||
typename ShapeDistanceFinder<ContourCombiner>::DistanceType ShapeDistanceFinder<ContourCombiner>::distance(const Point2 &origin) {
|
typename ShapeDistanceFinder<ContourCombiner>::DistanceType ShapeDistanceFinder<ContourCombiner>::distance(const Point2 &origin) {
|
||||||
contourCombiner.reset(origin);
|
contourCombiner.reset(origin);
|
||||||
typename ContourCombiner::EdgeSelectorType::EdgeCache *edgeCache = &shapeEdgeCache[0];
|
#ifdef MSDFGEN_USE_CPP11
|
||||||
|
typename ContourCombiner::EdgeSelectorType::EdgeCache *edgeCache = shapeEdgeCache.data();
|
||||||
|
#else
|
||||||
|
typename ContourCombiner::EdgeSelectorType::EdgeCache *edgeCache = shapeEdgeCache.empty() ? NULL : &shapeEdgeCache[0];
|
||||||
|
#endif
|
||||||
|
|
||||||
for (std::vector<Contour>::const_iterator contour = shape.contours.begin(); contour != shape.contours.end(); ++contour) {
|
for (std::vector<Contour>::const_iterator contour = shape.contours.begin(); contour != shape.contours.end(); ++contour) {
|
||||||
if (!contour->edges.empty()) {
|
if (!contour->edges.empty()) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
#include "edge-selectors.h"
|
#include "edge-selectors.h"
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include "arithmetics.hpp"
|
#include "arithmetics.hpp"
|
||||||
|
|
||||||
namespace msdfgen {
|
namespace msdfgen {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
#include "../msdfgen.h"
|
#include "../msdfgen.h"
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "edge-selectors.h"
|
#include "edge-selectors.h"
|
||||||
#include "contour-combiners.h"
|
#include "contour-combiners.h"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue