cogl-path: Fix the truncation when adding to a copied path

If a path is copied and then appended to, the copy needs to have the
last sub path truncated so that it fits in the total path size in case
the original path was modified. However the path size check was broken
so if the copied path had more than one sub path it would fail.
This commit is contained in:
Neil Roberts 2010-04-21 22:36:43 +01:00
parent 9d93e250d1
commit 308ca6cb14

View File

@ -77,7 +77,7 @@ _cogl_path_modify (CoglPath *path)
the total path size */ the total path size */
new_nodes = &g_array_index (path->path_nodes, CoglPathNode, 0); new_nodes = &g_array_index (path->path_nodes, CoglPathNode, 0);
for (i = 0; i < path->path_size; i += new_nodes[i].path_size) for (i = 0; i < path->path_size; i += new_nodes[i].path_size)
if (new_nodes[i].path_size >= path->path_size) if (i + new_nodes[i].path_size >= path->path_size)
new_nodes[i].path_size = path->path_size - i; new_nodes[i].path_size = path->path_size - i;
cogl_handle_unref (path->parent_path); cogl_handle_unref (path->parent_path);