#include <SkScaleToSides.h>
Definition at line 17 of file SkScaleToSides.h.
◆ AdjustRadii()
static void SkScaleToSides::AdjustRadii |
( |
double |
limit, |
|
|
double |
scale, |
|
|
SkScalar * |
a, |
|
|
SkScalar * |
b |
|
) |
| |
|
inlinestatic |
Definition at line 23 of file SkScaleToSides.h.
23 {
25
28
29 if (*
a + *
b > limit) {
32
33
34 if (*minRadius > *maxRadius) {
36 swap(minRadius, maxRadius);
37 }
38
39
40
41
42
43 float newMinRadius = *minRadius;
44
45 float newMaxRadius = (
float)(limit - newMinRadius);
46
47
48
49
50 while (newMaxRadius + newMinRadius > limit) {
51 newMaxRadius = nextafterf(newMaxRadius, 0.0f);
52 }
53 *maxRadius = newMaxRadius;
54 }
55
56 SkASSERTF(*
a >= 0.0f && *
b >= 0.0f,
"a: %g, b: %g, limit: %g, scale: %g", *
a, *
b, limit,
58
60 "\nlimit: %.17f, sum: %.17f, a: %.10f, b: %.10f, scale: %.20f",
62 }
#define SkASSERTF(cond, fmt,...)
void swap(sk_sp< T > &a, sk_sp< T > &b)
The documentation for this class was generated from the following file: