improve cairo draw options

This commit is contained in:
stefan schippers 2023-01-11 12:02:21 +01:00
parent 8aa4f06452
commit 115f0fdf0c
6 changed files with 2243 additions and 2221 deletions

View File

@ -402,6 +402,9 @@
<Component Id="cmp4FDAD50274CE6105999BB73BF884DD1D" Guid="{C0221391-25F9-4B31-9BCE-63E7B562680F}">
<File Id="fil324E6B620A90FA83D90F966DBBDA2AB8" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\parameters6.png" />
</Component>
<Component Id="cmpD4BAB551EED6B4F1DDA2816CC5E5C849" Guid="{57877C97-B55C-411D-BE5D-8DBD79CC5D11}">
<File Id="filF9B1D56918A6A02DAD7D2AE210589750" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\performance.html" />
</Component>
<Component Id="cmp9C9646BA969959CDB04692029FCBCFB1" Guid="{68A08CFA-C155-4223-A1B1-1BD00FC49634}">
<File Id="filEE7774C6FBEC9BEBE6D13D916B101DE1" KeyPath="yes" Source="$(var.docSrcDir)\xschem_man\pinnumber1.png" />
</Component>
@ -1081,6 +1084,7 @@
<ComponentRef Id="cmpF9280278155042E1B4DC007B03E1CCE6" />
<ComponentRef Id="cmp8737C923A2CD6802ED6E13112BBB6599" />
<ComponentRef Id="cmp4FDAD50274CE6105999BB73BF884DD1D" />
<ComponentRef Id="cmpD4BAB551EED6B4F1DDA2816CC5E5C849" />
<ComponentRef Id="cmp9C9646BA969959CDB04692029FCBCFB1" />
<ComponentRef Id="cmp7D05C60DDE4C4E276B03CA0BFA79AA8E" />
<ComponentRef Id="cmp80E23E69F6BFD335D5BE2C38F9C1FE2C" />

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -306,6 +306,9 @@
<Component Id="cmpF4FC3F6E15B37F2B56C3D20464B3641D" Guid="{4CB1D931-0AC6-4B08-9615-787C9C4B7254}">
<File Id="fil0312C8AA88667CDB6218849C74C319D5" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\devices\title-2.sym" />
</Component>
<Component Id="cmpABC9ED2BF2469C75509D8646381AFCB6" Guid="{5DB2C111-46D3-4741-A210-D57A9D5B105E}">
<File Id="filACC8A94F90D9320F50ED9121BBE3DC2A" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\devices\title-3.sym" />
</Component>
<Component Id="cmp590C970A5472F9E806FE1A1B562B96C4" Guid="{FB0C4844-E22F-4820-8964-BAAFBFA79089}">
<File Id="filC119E79A04C0274A93585E92A6BBFB77" KeyPath="yes" Source="$(var.xschemLibrarySrcDir)\devices\title.sym" />
</Component>
@ -5545,6 +5548,7 @@
<ComponentRef Id="cmp92D378095B64443F3454801FDB1FBF50" />
<ComponentRef Id="cmpB88C8475423DC9A430B279627C98B455" />
<ComponentRef Id="cmpF4FC3F6E15B37F2B56C3D20464B3641D" />
<ComponentRef Id="cmpABC9ED2BF2469C75509D8646381AFCB6" />
<ComponentRef Id="cmp590C970A5472F9E806FE1A1B562B96C4" />
<ComponentRef Id="cmp76DB4017109E1DB61562FC36BE015586" />
<ComponentRef Id="cmp0DD09CFEF555EC059CC337C508E047CA" />

View File

@ -760,7 +760,11 @@ static void drawgrid()
set_cairo_color(GRIDLAYER);
#endif
while(delta < CADGRIDTHRESHOLD) delta*=CADGRIDMULTIPLY; /* <-- to be improved,but works */
x = xctx->xorigin*xctx->mooz; y = xctx->yorigin*xctx->mooz;
#if DRAW_ALL_CAIRO==1
x =floor(xctx->xorigin*xctx->mooz) + 0.5; y = floor(xctx->yorigin*xctx->mooz) + 0.5;
#else
x =xctx->xorigin*xctx->mooz; y = xctx->yorigin*xctx->mooz;
#endif
if(y > xctx->areay1 && y < xctx->areay2) {
if(xctx->draw_window) {
#if DRAW_ALL_CAIRO==1
@ -799,16 +803,18 @@ static void drawgrid()
}
tmp = floor((xctx->areay1+1)/delta)*delta-fmod(-xctx->yorigin*xctx->mooz,delta);
for(x=floor((xctx->areax1+1)/delta)*delta-fmod(-xctx->xorigin*xctx->mooz,delta); x < xctx->areax2; x += delta) {
#if DRAW_ALL_CAIRO==1
double xx = floor(x) + 0.5;
#endif
for(y=tmp; y < xctx->areay2; y += delta) {
#if DRAW_ALL_CAIRO==1
double yy = floor(y) + 0.5;
if(xctx->draw_window) {
cairo_move_to(xctx->cairo_ctx, x, y);
/* cairo_line_to(xctx->cairo_ctx, x, y); */
cairo_move_to(xctx->cairo_ctx, xx, yy) ;
cairo_close_path(xctx->cairo_ctx);
}
if(xctx->draw_pixmap) {
cairo_move_to(xctx->cairo_save_ctx, x, y);
/* cairo_line_to(xctx->cairo_save_ctx, x, y); */
cairo_move_to(xctx->cairo_save_ctx, xx, yy);
cairo_close_path(xctx->cairo_save_ctx);
}
#else

View File

@ -1781,7 +1781,7 @@ static void resetcairo(int create, int clear, int force_or_resize)
cairo_toy_font_face_create(tclgetvar("cairo_font_name"), CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
/* dbg(0, "1 refcount=%d\n", cairo_font_face_get_reference_count(xctx->cairo_font)); */
xctx->cairo_save_ctx = cairo_create(xctx->cairo_save_sfc);
/* cairo_set_antialias (xctx->cairo_save_ctx, CAIRO_ANTIALIAS_NONE); */
cairo_set_antialias (xctx->cairo_save_ctx, CAIRO_ANTIALIAS_NONE);
cairo_set_font_face(xctx->cairo_save_ctx, xctx->cairo_font);
cairo_set_font_size(xctx->cairo_save_ctx, 20);
@ -1801,7 +1801,7 @@ static void resetcairo(int create, int clear, int force_or_resize)
fprintf(errfp, "ERROR: invalid cairo surface\n");
}
xctx->cairo_ctx = cairo_create(xctx->cairo_sfc);
/* cairo_set_antialias (xctx->cairo_ctx, CAIRO_ANTIALIAS_NONE); */
cairo_set_antialias (xctx->cairo_ctx, CAIRO_ANTIALIAS_NONE);
cairo_set_font_face(xctx->cairo_ctx, xctx->cairo_font);
cairo_set_font_size(xctx->cairo_ctx, 20);
cairo_set_font_options(xctx->cairo_ctx, options);