One really should use braces when mixing additions and multiplication and

2004-03-31  Simon Budig  <simon@gimp.org>

	* app/tools/gimptransformtool.c: One really should use braces
	when mixing additions and multiplication and the operator
	precedence is not the desired one...

	I feel stupid...  :-)
This commit is contained in:
Simon Budig 2004-03-31 14:21:36 +00:00 committed by Simon Budig
parent 4de398bb37
commit 157af2d30c
2 changed files with 16 additions and 8 deletions

View file

@ -1,3 +1,11 @@
2004-03-31 Simon Budig <simon@gimp.org>
* app/tools/gimptransformtool.c: One really should use braces
when mixing additions and multiplication and the operator
precedence is not the desired one...
I feel stupid... :-)
2004-03-31 Michael Natterer <mitch@gimp.org>
* app/core/gimp-transform-utils.c

View file

@ -685,14 +685,14 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
* if z1 and z2 have the same sign as well as z3 and z4
* the polygon is convex.
*/
z1 = (tr_tool->tx2-tr_tool->tx1 * tr_tool->ty4-tr_tool->ty1 -
tr_tool->tx4-tr_tool->tx1 * tr_tool->ty2-tr_tool->ty1);
z2 = (tr_tool->tx4-tr_tool->tx1 * tr_tool->ty3-tr_tool->ty1 -
tr_tool->tx3-tr_tool->tx1 * tr_tool->ty4-tr_tool->ty1);
z3 = (tr_tool->tx4-tr_tool->tx2 * tr_tool->ty3-tr_tool->ty2 -
tr_tool->tx3-tr_tool->tx2 * tr_tool->ty4-tr_tool->ty2);
z4 = (tr_tool->tx3-tr_tool->tx2 * tr_tool->ty1-tr_tool->ty2 -
tr_tool->tx1-tr_tool->tx2 * tr_tool->ty3-tr_tool->ty2);
z1 = ((tr_tool->tx2 - tr_tool->tx1) * (tr_tool->ty4 - tr_tool->ty1) -
(tr_tool->tx4 - tr_tool->tx1) * (tr_tool->ty2 - tr_tool->ty1));
z2 = ((tr_tool->tx4 - tr_tool->tx1) * (tr_tool->ty3 - tr_tool->ty1) -
(tr_tool->tx3 - tr_tool->tx1) * (tr_tool->ty4 - tr_tool->ty1));
z3 = ((tr_tool->tx4 - tr_tool->tx2) * (tr_tool->ty3 - tr_tool->ty2) -
(tr_tool->tx3 - tr_tool->tx2) * (tr_tool->ty4 - tr_tool->ty2));
z4 = ((tr_tool->tx3 - tr_tool->tx2) * (tr_tool->ty1 - tr_tool->ty2) -
(tr_tool->tx1 - tr_tool->tx2) * (tr_tool->ty3 - tr_tool->ty2));
/* Draw the grid (not for path transform since it looks ugly) */