1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 21:28:38 +02:00

sch2fig/: make gfx_ops->line optional; add COLOR_WHITE; add color map

This commit is contained in:
Werner Almesberger 2016-07-30 23:43:49 -03:00
parent d1657de267
commit 4e8870d193
3 changed files with 21 additions and 3 deletions

View File

@ -11,7 +11,7 @@
#
NAME = sch2fig
OBJS = main.o sch.o lib.o fig.o gfx.o dwg.o text.o misc.o
OBJS = main.o sch.o lib.o style.o fig.o gfx.o dwg.o text.o misc.o
CFLAGS = -g -O -Wall -Wextra -Wno-unused-parameter -Wshadow
LIBS = -lm

View File

@ -11,6 +11,7 @@
*/
#include "style.h"
#include "text.h"
#include "gfx.h"
@ -21,7 +22,15 @@ static void *gfx_ctx;
void gfx_line(int sx, int sy, int ex, int ey, int color, unsigned layer)
{
if (gfx_ops->line) {
gfx_ops->line(gfx_ctx, sx, sy, ex, ey, color, layer);
return;
}
int vx[] = { sx, ex };
int vy[] = { sy, sy };
gfx_poly(2, vx, vy, color, COLOR_NONE, layer);
}

View File

@ -1,5 +1,5 @@
/*
* style.h - FIG drawing style
* style.h - Drawing style
*
* Written 2016 by Werner Almesberger
* Copyright 2016 by Werner Almesberger
@ -13,10 +13,16 @@
#ifndef STYLE_H
#define STYLE_H
#include <stdint.h>
/* FIG colors */
#define COLOR_NONE -1
#define COLOR_BLACK 0
#define COLOR_BLUE 1
#define COLOR_YELLOW 6
#define COLOR_WHITE 7
#define COLOR_GREEN4 12
#define COLOR_CYAN4 15
#define COLOR_CYAN3 16
@ -77,4 +83,7 @@
#define NEWLINE_SKIP 1.4 // * text size
extern uint32_t color_rgb[];
#endif /* !STYLE_H */