diff options
author | David Robillard <d@drobilla.net> | 2014-01-03 22:24:11 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-01-03 22:24:11 +0000 |
commit | 3517286a9404d556c384276d63b73b588fadbcfe (patch) | |
tree | 21d755eaeebace222216b3ab294ea200171fe3a2 /src/edge.c | |
parent | 9191aae81ab497d9cbf5a256b2b2e9dbf1af5d67 (diff) | |
download | ganv-3517286a9404d556c384276d63b73b588fadbcfe.tar.gz ganv-3517286a9404d556c384276d63b73b588fadbcfe.tar.bz2 ganv-3517286a9404d556c384276d63b73b588fadbcfe.zip |
Draw and layout performance improvements.
git-svn-id: http://svn.drobilla.net/lad/trunk/ganv@5248 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/edge.c')
-rw-r--r-- | src/edge.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -267,10 +267,13 @@ ganv_edge_get_coords(const GanvEdge* edge, GanvEdgeCoords* coords) coords->handle_x = coords->x1 + (dx / 2.0); coords->handle_y = coords->y1 + (dy / 2.0); - coords->cx1 = coords->x1 + (coords->cx1 * (ceil(fabs(dx)) / 4.0)); - coords->cy1 = coords->y1 + (coords->cy1 * (ceil(fabs(dy)) / 4.0)); - coords->cx2 = coords->x2 + (coords->cx2 * (ceil(fabs(dx)) / 4.0)); - coords->cy2 = coords->y2 + (coords->cy2 * (ceil(fabs(dy)) / 4.0)); + const double abs_dx = fabs(dx); + const double abs_dy = fabs(dy); + + coords->cx1 = coords->x1 + (coords->cx1 * (abs_dx / 4.0)); + coords->cy1 = coords->y1 + (coords->cy1 * (abs_dy / 4.0)); + coords->cx2 = coords->x2 + (coords->cx2 * (abs_dx / 4.0)); + coords->cy2 = coords->y2 + (coords->cy2 * (abs_dy / 4.0)); } static void |