mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
macOS: Prevent negative corner sizes for rounded rectangles
This commit is contained in:
parent
51edcaf842
commit
2d360165c5
1 changed files with 4 additions and 4 deletions
|
|
@ -654,12 +654,12 @@ void CoreGraphicsContext::drawRoundedRectangle (const Rectangle<float>& r, float
|
||||||
|
|
||||||
detail::MutablePathPtr path { CGPathCreateMutable() };
|
detail::MutablePathPtr path { CGPathCreateMutable() };
|
||||||
CGPathAddRoundedRect (path.get(), nullptr, convertToCGRectFlipped (outsideRect),
|
CGPathAddRoundedRect (path.get(), nullptr, convertToCGRectFlipped (outsideRect),
|
||||||
jmin (outsideCornerSize, outsideRect.getWidth() / 2.0f),
|
std::clamp (outsideCornerSize, 0.0f, outsideRect.getWidth() / 2.0f),
|
||||||
jmin (outsideCornerSize, outsideRect.getHeight() / 2.0f));
|
std::clamp (outsideCornerSize, 0.0f, outsideRect.getHeight() / 2.0f));
|
||||||
|
|
||||||
CGPathAddRoundedRect (path.get(), nullptr, convertToCGRectFlipped (insideRect),
|
CGPathAddRoundedRect (path.get(), nullptr, convertToCGRectFlipped (insideRect),
|
||||||
jmin (insideCornerSize, insideRect.getWidth() / 2.0f),
|
std::clamp (insideCornerSize, 0.0f, insideRect.getWidth() / 2.0f),
|
||||||
jmin (insideCornerSize, insideRect.getHeight() / 2.0f));
|
std::clamp (insideCornerSize, 0.0f, insideRect.getHeight() / 2.0f));
|
||||||
|
|
||||||
CGContextAddPath (context.get(), path.get());
|
CGContextAddPath (context.get(), path.get());
|
||||||
drawCurrentPath (kCGPathEOFill);
|
drawCurrentPath (kCGPathEOFill);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue