summaryrefslogtreecommitdiff
path: root/src/solve.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/solve.c')
-rw-r--r--src/solve.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/solve.c b/src/solve.c
index 9a629f4..be16663 100644
--- a/src/solve.c
+++ b/src/solve.c
@@ -60,20 +60,20 @@ static void add_frontier(struct frontier *frontier, struct component *component)
frontier->elems[frontier->n++] = component;
}
-static void build_angle_point_line(struct drawing *drawing, struct constraint *i, struct constraint *j, struct component *local_i, struct component *local_j, struct component *oppo_i) {
+static void build_angle_point_line(struct drawing *drawing, size_t index_i, size_t index_j, struct component *local_i, struct component *local_j, struct component *oppo_i) {
assert(local_i->e != NULL);
assert(local_j->e != NULL);
assert(local_i->type == COM_LINE);
assert(local_j->type == COM_POINT);
struct element *theta = insert_cmd(drawing, (struct command){
.op = CMD_VALUE_INPUT,
- .index = i->order-1,
+ .index = index_i,
.result.type = ETYPE_VALUE,
});
struct element *d = insert_cmd(drawing, (struct command){
.op = CMD_VALUE_INPUT,
- .index = j->order-1,
+ .index = index_j,
.result.type = ETYPE_VALUE,
});
@@ -394,13 +394,13 @@ static void draw_solution(struct constraint *constraints, size_t fix, struct sol
} else {
struct element *d1 = insert_cmd(drawing, (struct command){
.op = CMD_VALUE_INPUT,
- .index = constraints[step->i].order-1,
+ .index = step->i,
.result.type = ETYPE_VALUE,
});
struct element *d2 = insert_cmd(drawing, (struct command){
.op = CMD_VALUE_INPUT,
- .index = constraints[step->j].order-1,
+ .index = step->j,
.result.type = ETYPE_VALUE,
});
@@ -436,12 +436,12 @@ static void draw_solution(struct constraint *constraints, size_t fix, struct sol
struct element *d1 = insert_cmd(drawing, (struct command){
.op = CMD_VALUE_INPUT,
- .index = constraints[step->i].order-1,
+ .index = step->i,
.result.type = ETYPE_VALUE,
});
struct element *d2 = insert_cmd(drawing, (struct command){
.op = CMD_VALUE_INPUT,
- .index = constraints[step->j].order-1,
+ .index = step->j,
.result.type = ETYPE_VALUE,
});
@@ -476,12 +476,12 @@ static void draw_solution(struct constraint *constraints, size_t fix, struct sol
struct element *d1 = insert_cmd(drawing, (struct command){
.op = CMD_VALUE_INPUT,
- .index = constraints[step->i].order-1,
+ .index = step->i,
.result.type = ETYPE_VALUE,
});
struct element *d2 = insert_cmd(drawing, (struct command){
.op = CMD_VALUE_INPUT,
- .index = constraints[step->j].order-1,
+ .index = step->j,
.result.type = ETYPE_VALUE,
});
@@ -517,7 +517,7 @@ static void draw_solution(struct constraint *constraints, size_t fix, struct sol
constraints[step->i].forward = step->i_forward;
constraints[step->j].forward = step->j_forward;
- build_angle_point_line(drawing, &constraints[step->i], &constraints[step->j], local_i, local_j, oppo_i);
+ build_angle_point_line(drawing, step->i, step->j, local_i, local_j, oppo_i);
} else if(constraints[step->i].type == CT_POINT_LINE_DISTANCE
&& local_i->type == COM_POINT
&& constraints[step->j].type == CT_LINE_LINE_ANGLE
@@ -527,7 +527,7 @@ static void draw_solution(struct constraint *constraints, size_t fix, struct sol
constraints[step->i].forward = step->i_forward;
constraints[step->j].forward = step->j_forward;
- build_angle_point_line(drawing, &constraints[step->j], &constraints[step->i], local_j, local_i, oppo_i);
+ build_angle_point_line(drawing, step->j, step->i, local_j, local_i, oppo_i);
} else if(constraints[step->i].type == CT_POINT_LINE_DISTANCE
&& local_i->type == COM_LINE
&& constraints[step->j].type == CT_POINT_POINT_DISTANCE
@@ -536,12 +536,12 @@ static void draw_solution(struct constraint *constraints, size_t fix, struct sol
struct element *d1 = insert_cmd(drawing, (struct command){
.op = CMD_VALUE_INPUT,
- .index = constraints[step->i].order-1,
+ .index = step->i,
.result.type = ETYPE_VALUE,
});
struct element *d2 = insert_cmd(drawing, (struct command){
.op = CMD_VALUE_INPUT,
- .index = constraints[step->j].order-1,
+ .index = step->j,
.result.type = ETYPE_VALUE,
});