This commit is contained in:
Vojtech Bubnik 2022-05-17 12:49:08 +02:00
commit cc79a9fe7a
3 changed files with 6 additions and 4 deletions

View file

@ -129,9 +129,10 @@ GroundingLocation Layer::getBestGroundingLocation
if (contour.size() > 2) { if (contour.size() > 2) {
Point prev = contour.points.back(); Point prev = contour.points.back();
for (const Point &p2 : contour.points) { for (const Point &p2 : contour.points) {
if (double d = Line::distance_to_squared(unsupported_location, prev, p2); d < d2) { Point closest_point;
if (double d = line_alg::distance_to_squared(Line{prev, p2}, unsupported_location, &closest_point); d < d2) {
d2 = d; d2 = d;
node_location = Geometry::foot_pt({ prev, p2 }, unsupported_location).cast<coord_t>(); node_location = closest_point;
} }
prev = p2; prev = p2;
} }

View file

@ -141,7 +141,7 @@ static bool check_internet_connection_win()
{ {
bool internet = true; // return true if COM object creation fails. bool internet = true; // return true if COM object creation fails.
if (CoInitializeEx(NULL, COINIT_APARTMENTTHREADED) == S_OK) { if (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED))) {
{ {
CComPtr<INetworkListManager> pNLM; CComPtr<INetworkListManager> pNLM;
if (pNLM.CoCreateInstance(CLSID_NetworkListManager) == S_OK) { if (pNLM.CoCreateInstance(CLSID_NetworkListManager) == S_OK) {

View file

@ -181,7 +181,7 @@ Http::priv::~priv()
bool Http::priv::ca_file_supported(::CURL *curl) bool Http::priv::ca_file_supported(::CURL *curl)
{ {
#ifdef _WIN32 #if defined(_WIN32) || defined(__APPLE__)
bool res = false; bool res = false;
#else #else
bool res = true; bool res = true;
@ -194,6 +194,7 @@ bool Http::priv::ca_file_supported(::CURL *curl)
if (::curl_easy_getinfo(curl, CURLINFO_TLS_SSL_PTR, &tls) == CURLE_OK) { if (::curl_easy_getinfo(curl, CURLINFO_TLS_SSL_PTR, &tls) == CURLE_OK) {
if (tls->backend == CURLSSLBACKEND_SCHANNEL || tls->backend == CURLSSLBACKEND_DARWINSSL) { if (tls->backend == CURLSSLBACKEND_SCHANNEL || tls->backend == CURLSSLBACKEND_DARWINSSL) {
// With Windows and OS X native SSL support, cert files cannot be set // With Windows and OS X native SSL support, cert files cannot be set
// DK: OSX is now not building CURL and links system one, thus we do not know which backend is installed. Still, false will be returned since the ifdef at the begining if this function.
res = false; res = false;
} }
} }