Skip to content
Snippets Groups Projects
Commit 5722cba1 authored by Timur Pocheptsov's avatar Timur Pocheptsov
Browse files

Get rid this piece of sh...ame.

parent 0181a91e
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment