Merge branch 'master' into cairo-dev

This commit is contained in:
Mario Hüttel 2018-07-20 22:41:16 +02:00
commit d4f2d6798e
3 changed files with 11 additions and 9 deletions

View File

@ -726,21 +726,22 @@ int parse_gds_from_file(const char *filename, GList **library_list)
current_cell = NULL; current_cell = NULL;
printf("Leaving Cell\n"); printf("Leaving Cell\n");
break; break;
//case BOX: case BOX:
case BOUNDARY: case BOUNDARY:
if (current_cell == NULL) { if (current_cell == NULL) {
GDS_ERROR("Boundary outside of cell"); GDS_ERROR("Boundary/Box outside of cell");
run = -3; run = -3;
break; break;
} }
current_cell->graphic_objs = append_graphics(current_cell->graphic_objs, current_cell->graphic_objs = append_graphics(current_cell->graphic_objs,
GRAPHIC_POLYGON, &current_graphics); (rec_type == BOUNDARY ? GRAPHIC_POLYGON : GRAPHIC_BOX),
&current_graphics);
if (current_cell->graphic_objs == NULL) { if (current_cell->graphic_objs == NULL) {
GDS_ERROR("Memory allocation failed"); GDS_ERROR("Memory allocation failed");
run = -4; run = -4;
break; break;
} }
printf("\tEntering boundary\n"); printf("\tEntering boundary/Box\n");
break; break;
case SREF: case SREF:
if (current_cell == NULL) { if (current_cell == NULL) {
@ -794,6 +795,7 @@ int parse_gds_from_file(const char *filename, GList **library_list)
} }
break; break;
case MAG: case MAG:
break; break;
case ANGLE: case ANGLE:

View File

@ -6,7 +6,7 @@
#define CELL_NAME_MAX (100) #define CELL_NAME_MAX (100)
enum graphics_type {GRAPHIC_PATH = 0, GRAPHIC_POLYGON = 1}; enum graphics_type {GRAPHIC_PATH = 0, GRAPHIC_POLYGON = 1, GRAPHIC_BOX};
enum path_type {PATH_FLUSH = 0, PATH_ROUNDED = 1, PATH_SQUARED = 2}; enum path_type {PATH_FLUSH = 0, PATH_ROUNDED = 1, PATH_SQUARED = 2};
struct gds_point { struct gds_point {

View File

@ -95,7 +95,7 @@ static void generate_graphics(FILE *tex_file, GList *graphics, GList *linfo, GSt
if (write_layer_env(tex_file, &color, (int)gfx->layer, linfo, buffer) == TRUE) { if (write_layer_env(tex_file, &color, (int)gfx->layer, linfo, buffer) == TRUE) {
/* Layer is defined => create graphics */ /* Layer is defined => create graphics */
if (gfx->gfx_type == GRAPHIC_POLYGON) { if (gfx->gfx_type == GRAPHIC_POLYGON || gfx->gfx_type == GRAPHIC_BOX ) {
g_string_printf(buffer, "\\draw[line width=0.00001 pt, draw={c%d}, fill={c%d}, fill opacity={%lf}] ", g_string_printf(buffer, "\\draw[line width=0.00001 pt, draw={c%d}, fill={c%d}, fill opacity={%lf}] ",
gfx->layer, gfx->layer, color.alpha); gfx->layer, gfx->layer, color.alpha);
WRITEOUT_BUFFER(buffer); WRITEOUT_BUFFER(buffer);
@ -107,7 +107,7 @@ static void generate_graphics(FILE *tex_file, GList *graphics, GList *linfo, GSt
} }
g_string_printf(buffer, "cycle;\n"); g_string_printf(buffer, "cycle;\n");
WRITEOUT_BUFFER(buffer); WRITEOUT_BUFFER(buffer);
} else if(gfx->gfx_type == GRAPHIC_PATH) { } else if (gfx->gfx_type == GRAPHIC_PATH) {
if (g_list_length(gfx->vertices) < 2) { if (g_list_length(gfx->vertices) < 2) {
printf("Cannot write path with less than 2 points\n"); printf("Cannot write path with less than 2 points\n");
@ -116,7 +116,7 @@ static void generate_graphics(FILE *tex_file, GList *graphics, GList *linfo, GSt
if (gfx->path_render_type < 0 || gfx->path_render_type > 2) { if (gfx->path_render_type < 0 || gfx->path_render_type > 2) {
printf("Path type unrecognized. Setting to 'flushed'\n"); printf("Path type unrecognized. Setting to 'flushed'\n");
gfx->path_render_type = 0; gfx->path_render_type = PATH_FLUSH;
} }
g_string_printf(buffer, "\\draw[line width=%lf pt, draw={c%d}, opacity={%lf}, cap=%s] ", g_string_printf(buffer, "\\draw[line width=%lf pt, draw={c%d}, opacity={%lf}, cap=%s] ",
@ -171,7 +171,7 @@ static void render_cell(struct gds_cell *cell, GList *layer_infos, FILE *tex_fil
WRITEOUT_BUFFER(buffer); WRITEOUT_BUFFER(buffer);
g_string_printf(buffer, "\\begin{scope}[yscale=%lf, xscale=%lf]\n", (inst->flipped ? -1*inst->magnification : inst->magnification), g_string_printf(buffer, "\\begin{scope}[yscale=%lf, xscale=%lf]\n", (inst->flipped ? -1*inst->magnification : inst->magnification),
inst->magnification); inst->magnification);
WRITEOUT_BUFFER(buffer); WRITEOUT_BUFFER(buffer);
render_cell(inst->cell_ref, layer_infos, tex_file, buffer, scale); render_cell(inst->cell_ref, layer_infos, tex_file, buffer, scale);