[cairo-commit] src/cairo-font-face-twin.c
Behdad Esfahbod
behdad at kemper.freedesktop.org
Sat Dec 27 13:26:03 PST 2008
src/cairo-font-face-twin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit f2f62c7c4402a28a65c8171238d163af6b2fb95a
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Fri Dec 26 20:28:54 2008 -0500
[twin] Micro-optimize
diff --git a/src/cairo-font-face-twin.c b/src/cairo-font-face-twin.c
index 4fe6f89..c905b27 100644
--- a/src/cairo-font-face-twin.c
+++ b/src/cairo-font-face-twin.c
@@ -235,7 +235,7 @@ compute_hinting_scale (cairo_t *cr,
double *scale, double *inv)
{
cairo_user_to_device_distance (cr, &x, &y);
- *scale = sqrt (x*x + y*y);
+ *scale = x == 0 ? y : y == 0 ? x :sqrt (x*x + y*y);
*inv = 1 / *scale;
}
More information about the cairo-commit
mailing list