ScfEboard* b = scf_eboard__unpack(NULL, len, pb);
- ses_layout_board(b, 0, 0, 500, 500);
+ ses_layout_board(b);
#if 0
size_t i;
size_t j;
return 0;
}
-int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, uint32_t bw, uint32_t bh)
+int ses_layout_function(ScfEfunction* f, int d)
{
ScfEcomponent* c0;
ScfEcomponent* c1;
size_t m;
size_t n;
- f->x = bx;
- f->y = by;
+ f->x = 0;
+ f->y = 0;
f->w = 0;
f->h = 0;
if (!l0)
return -ENOMEM;
- l0->x0 = bx;
- l0->x1 = bx;
- l0->y0 = by + i * d;
+ l0->x0 = d;
+ l0->x1 = d;
+ l0->y0 = d + i * d;
l0->y1 = l0->y0;
if (scf_eline__add_line(el0, l0) < 0) {
}
}
+ f->w += d;
+ f->h += d;
+
scf_loge("f->x: %d, y: %d, w: %d, h: %d\n", f->x, f->y, f->w, f->h);
for (i = 0; i < f->n_components; i++) {
return 0;
}
-int ses_layout_board(ScfEboard* b, uint32_t x, uint32_t y, uint32_t w, uint32_t h)
+int ses_layout_board(ScfEboard* b)
{
ScfEfunction* f;
size_t j;
size_t k;
+ int x = 0;
+ int y = 0;
+ int w = 0;
+ int h = 0;
+
for (i = 0; i < b->n_functions; i++) {
f = b->functions[i];
ses_lines_same_components(f);
- int ret = ses_layout_function(f, 50, x + 50, y + 50, w - 50, h - 50);
+ int ret = ses_layout_function(f, 50);
if (ret < 0) {
scf_loge("\n");
return ret;
}
+
+ x = f->x;
+ y = f->y;
+ w = f->w;
+ h = f->h;
}
ses_layout_draw(b, x, y, w, h);
#include"scf_eda_pb.h"
#include"scf_vector.h"
-int ses_layout_board(ScfEboard* b, uint32_t x, uint32_t y, uint32_t w, uint32_t h);
+int ses_layout_board(ScfEboard* b);
#endif