Skip to content

Commit

Permalink
Merge pull request #70 from drahnr/new-view-mechanics
Browse files Browse the repository at this point in the history
Manual intervention was required
  • Loading branch information
Bernhard Schuster committed Aug 8, 2013
2 parents 3e2ac77 + a7d154c commit 98400f1
Show file tree
Hide file tree
Showing 31 changed files with 1,313 additions and 738 deletions.
9 changes: 9 additions & 0 deletions src/coords.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,12 @@ coords_set (Coords *a, Coords *val)
a->y = val->y;
return a;
}

inline Coords
coords_average (const Coords *a, const Coords *b)
{
Coords r = (Coords)(*a);
r.x += b->x; r.x /= 2.0;
r.y += b->y; r.y /= 2.0;
return r;
}
6 changes: 6 additions & 0 deletions src/coords.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@ coords_sum (Coords *a, Coords *b);
Coords
coords_sub (Coords *a, Coords *b);


/*
* calculates the average of two points
*/
Coords
coords_average (const Coords *a, const Coords *b);
#endif /* __COORDS_H */
4 changes: 2 additions & 2 deletions src/load-schematic.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ create_wire (ParseState *state)
length.x = state->wire_end.x - start_pos.x;
length.y = state->wire_end.y - start_pos.y;

wire = wire_new ();
wire = wire_new (NULL); //FIXME need to set this reliably later on!
wire_set_length (wire, &length);

item_data_set_pos (ITEM_DATA (wire), &state->wire_start);
Expand All @@ -231,7 +231,7 @@ create_part (ParseState *state)
Part *part;
LibraryPart *library_part = state->part;

part = part_new_from_library_part (library_part);
part = part_new_from_library_part (library_part, NULL); //FIXME need to set this reliably later on!
if (!part)
return;

Expand Down
Loading

0 comments on commit 98400f1

Please sign in to comment.