diff --git a/graf2d/quartz/src/QuartzFillArea.mm b/graf2d/quartz/src/QuartzFillArea.mm index 25f36281bb92a98721d71e36956f44842e4fd71f..ce1bcb8a7835e8cf5e3c928e7bc7b0051355b95f 100644 --- a/graf2d/quartz/src/QuartzFillArea.mm +++ b/graf2d/quartz/src/QuartzFillArea.mm @@ -217,14 +217,14 @@ bool CalculateSimpleRadialGradientParameters(const TRadialGradient *grad, CGPoint center = CGPointMake(grad->GetCenter().fX, grad->GetCenter().fY); if (grad->GetCoordinateMode() == TColorGradient::kObjectBoundingMode) { - const CGFloat scale = bbox.size.width < bbox.size.height ? - bbox.size.height : bbox.size.width; + const CGFloat scale = std::max(bbox.size.width, bbox.size.height); + radius *= scale; center.x = bbox.size.width * center.x + bbox.origin.x; center.y = bbox.size.height * center.y + bbox.origin.y; } else { - const CGFloat scale = sizeOfDrawable.width < sizeOfDrawable.height ? - sizeOfDrawable.height : sizeOfDrawable.width; + const CGFloat scale = std::max(sizeOfDrawable.width, sizeOfDrawable.height); + radius *= scale; center.x *= sizeOfDrawable.width; center.y *= sizeOfDrawable.height;