diff --git a/modules/juce_graphics/geometry/juce_Line.h b/modules/juce_graphics/geometry/juce_Line.h index 95665c5235..b13ad0d180 100644 --- a/modules/juce_graphics/geometry/juce_Line.h +++ b/modules/juce_graphics/geometry/juce_Line.h @@ -224,8 +224,8 @@ public: if (length <= 0) return start; - return Point (start.x + static_cast ((delta.x * distanceFromStart - delta.y * perpendicularDistance) / length), - start.y + static_cast ((delta.y * distanceFromStart + delta.x * perpendicularDistance) / length)); + return Point (start.x + static_cast ((delta.x * distanceFromStart - delta.y * perpendicularDistance) / length), + start.y + static_cast ((delta.y * distanceFromStart + delta.x * perpendicularDistance) / length)); } /** Returns the location of the point which is a given distance along this line @@ -267,7 +267,7 @@ public: if (prop >= 0 && prop <= 1.0) { - pointOnLine = start + delta * static_cast (prop); + pointOnLine = start + delta * static_cast (prop); return targetPoint.getDistanceFrom (pointOnLine); } } @@ -301,9 +301,9 @@ public: const double length = delta.x * delta.x + delta.y * delta.y; return length <= 0 ? 0 - : jlimit (ValueType(), static_cast (1), - static_cast ((((point.x - start.x) * delta.x - + (point.y - start.y) * delta.y) / length))); + : jlimit (ValueType(), static_cast (1), + static_cast ((((point.x - start.x) * delta.x + + (point.y - start.y) * delta.y) / length))); } /** Finds the point on this line which is nearest to a given point. @@ -375,40 +375,40 @@ private: { const ValueType along = (p1.y - p3.y) / d2.y; intersection = p1.withX (p3.x + along * d2.x); - return along >= 0 && along <= static_cast (1); + return along >= 0 && along <= static_cast (1); } else if (d2.y == 0 && d1.y != 0) { const ValueType along = (p3.y - p1.y) / d1.y; intersection = p3.withX (p1.x + along * d1.x); - return along >= 0 && along <= static_cast (1); + return along >= 0 && along <= static_cast (1); } else if (d1.x == 0 && d2.x != 0) { const ValueType along = (p1.x - p3.x) / d2.x; intersection = p1.withY (p3.y + along * d2.y); - return along >= 0 && along <= static_cast (1); + return along >= 0 && along <= static_cast (1); } else if (d2.x == 0 && d1.x != 0) { const ValueType along = (p3.x - p1.x) / d1.x; intersection = p3.withY (p1.y + along * d1.y); - return along >= 0 && along <= static_cast (1); + return along >= 0 && along <= static_cast (1); } } - intersection = (p2 + p3) / static_cast (2); + intersection = (p2 + p3) / static_cast (2); return false; } const ValueType along1 = ((p1.y - p3.y) * d2.x - (p1.x - p3.x) * d2.y) / divisor; intersection = p1 + d1 * along1; - if (along1 < 0 || along1 > static_cast (1)) + if (along1 < 0 || along1 > static_cast (1)) return false; const ValueType along2 = ((p1.y - p3.y) * d1.x - (p1.x - p3.x) * d1.y) / divisor; - return along2 >= 0 && along2 <= static_cast (1); + return along2 >= 0 && along2 <= static_cast (1); } }; diff --git a/modules/juce_gui_basics/native/juce_ios_Windowing.mm b/modules/juce_gui_basics/native/juce_ios_Windowing.mm index 6df6db061e..11af512e31 100644 --- a/modules/juce_gui_basics/native/juce_ios_Windowing.mm +++ b/modules/juce_gui_basics/native/juce_ios_Windowing.mm @@ -294,10 +294,10 @@ void SystemClipboard::copyTextToClipboard (const String& text) String SystemClipboard::getTextFromClipboard() { - NSString* text = [[UIPasteboard generalPasteboard] valueForPasteboardType: @"public.text"]; + if (NSString* text = [[UIPasteboard generalPasteboard] valueForPasteboardType: @"public.text"]) + return nsStringToJuce (text); - return text == nil ? String::empty - : nsStringToJuce (text); + return String(); } //==============================================================================