summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-23 18:12:44 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-23 18:20:45 -0300
commitff75c07423e278ae0e2c6effe4bde1a4fc19965f (patch)
tree3caeabe6618a624e4f87f0d95c41f6f0a3460bb6
parentc2de063fc1c4a0816984588db335e20cd4446fe1 (diff)
downloadeeshow-ff75c07423e278ae0e2c6effe4bde1a4fc19965f.tar.gz
eeshow-ff75c07423e278ae0e2c6effe4bde1a4fc19965f.tar.bz2
eeshow-ff75c07423e278ae0e2c6effe4bde1a4fc19965f.zip
gfx/cro.c: use "double" for coordinate conversions
This has a number of amazing effects: - font over-sizing issues almost completely disappear (they can still get a bit too small( - PDFs no longer show rounding effects at default scale Drawback: - there is now more anti-aliasing, making things look slightly blurred
-rw-r--r--TODO3
-rw-r--r--gfx/cro.c11
2 files changed, 7 insertions, 7 deletions
diff --git a/TODO b/TODO
index dfa11ab..e755580 100644
--- a/TODO
+++ b/TODO
@@ -22,6 +22,8 @@ Visualization (dwg.c and such):
- nesting gfx in diff is a huge kludge, caused by global vars in gfx.c
Rendering:
+- why does "NRESWARM-CPU" (70 mil) on sheet 27 (eMMC) grow outside its box ?
+ None of the others (60 mil) do.
- better text size guessing also for FIG
- consider switching to Hershey fonts (that's what eeschema uses, right ?)
(goal: prevent font geometry from changing when scaling)
@@ -40,7 +42,6 @@ Rendering:
- PDF has visible rounding errors at the default scale
GUI:
-- fonts grow beyond their bounding boxes when zooming in
- dragging can be slow. maybe reusing old content and only redrawing new
will help ?
- highlight nets ?
diff --git a/gfx/cro.c b/gfx/cro.c
index af5faf5..903126d 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -63,25 +63,25 @@ struct cro_ctx {
};
-static inline int cd(const struct cro_ctx *cc, int x)
+static inline double cd(const struct cro_ctx *cc, int x)
{
return x * cc->scale;
}
-static inline int dc(const struct cro_ctx *cc, int x)
+static inline double dc(const struct cro_ctx *cc, double x)
{
return x / cc->scale;
}
-static inline int cx(const struct cro_ctx *cc, int x)
+static inline double cx(const struct cro_ctx *cc, int x)
{
return cc->xo + x * cc->scale;
}
-static inline int cy(const struct cro_ctx *cc, int y)
+static inline double cy(const struct cro_ctx *cc, int y)
{
return cc->yo + y * cc->scale;
}
@@ -235,7 +235,7 @@ static unsigned cr_text_width(void *ctx, const char *s, unsigned size)
cairo_set_font_size(cc->cr, cd(cc, size) * TEXT_STRETCH);
cairo_text_extents(cc->cr, s, &ext);
- return dc(cc, ext.width) * 1.05; /* @@@ Cairo seems to underestimate */
+ return dc(cc, ext.width);
}
@@ -457,7 +457,6 @@ static void cr_pdf_end(void *ctx)
if (cc->toc)
pdftoc_end(cc->toc);
-
}