]> granicus.if.org Git - graphviz/commitdiff
Use int for DPI.
authorellson <devnull@localhost>
Wed, 5 Jan 2005 23:28:07 +0000 (23:28 +0000)
committerellson <devnull@localhost>
Wed, 5 Jan 2005 23:28:07 +0000 (23:28 +0000)
various minor bugs

cmd/dot/plugins.c
cmd/tools/plugins.c
configure.ac
graphviz.spec.in
lib/common/macros.h
lib/gvc/gvrender.c
lib/gvc/gvrenderint.h
tclpkg/tcldot/tcldot.c

index bbdb0f9f82cdb7bba87272ce83df71fd3715a88b..11c9899ad305b9e9b1ad01e320f4357b7ded3e39 100644 (file)
@@ -26,7 +26,7 @@ extern gvplugin_t gvplugin_cairo_LTX_plugin,
     gvplugin_gd_LTX_plugin,
     gvplugin_text_LTX_plugin;
 #endif
-extern gvplugin_layout_LTX_plugin;
+extern gvplugin_t gvplugin_layout_LTX_plugin;
 
 gvplugin_t *builtins[] = {
 #ifndef DISABLE_GVRENDER
index bbdb0f9f82cdb7bba87272ce83df71fd3715a88b..11c9899ad305b9e9b1ad01e320f4357b7ded3e39 100644 (file)
@@ -26,7 +26,7 @@ extern gvplugin_t gvplugin_cairo_LTX_plugin,
     gvplugin_gd_LTX_plugin,
     gvplugin_text_LTX_plugin;
 #endif
-extern gvplugin_layout_LTX_plugin;
+extern gvplugin_t gvplugin_layout_LTX_plugin;
 
 gvplugin_t *builtins[] = {
 #ifndef DISABLE_GVRENDER
index 5f6d952212d0a860522dd2c04eed280a97d199cb..7795cde756d64e13b3bd94c17129094e3bb010c6 100644 (file)
@@ -52,7 +52,7 @@ AC_SUBST(DARWIN)
 AC_DEFINE_UNQUOTED(DEFAULT_FONTPATH,"$DEFAULT_FONTPATH",Path to TrueType fonts.)
 AC_DEFINE_UNQUOTED(PATHSEPARATOR,"$PATHSEPARATOR",Path separator character.)
 
-DEFAULT_DPI=96.0
+DEFAULT_DPI=96
 AC_DEFINE_UNQUOTED(DEFAULT_DPI,$DEFAULT_DPI,Default DPI.)
 
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
index 46206afa7fcb60801961f1f44d40c27df50af7fa..40207b8ec242eecc5978a838ab64dc74659cf066 100644 (file)
@@ -85,7 +85,7 @@ The %{name}-doc package provides some additional PDF and HTML documentation for
       --datadir=%{_datadir} \
       --mandir=%{_mandir} \
       --with-x \
-      --enable-gvrender \
+      --disable-gvrender \
       --with-mylibgd
 # need gd-2.0.29 commonly available in rpms before removing --enable-mylibgd
 %__make %{?_smp_mflags}
index 41e90fb23d78e37ae7876b8ba62de3fd7925db48..7c7b263bc9b5c68596d6c5e128b6b906597d54b2 100644 (file)
@@ -89,9 +89,9 @@
 #define RADIANS(deg)   ((deg)/180.0 * PI)
 #define DEGREES(rad)   ((rad)/PI * 180.0)
 #define DIST(x1,y1,x2,y2) (sqrt(((x1) - (x2))*((x1) - (x2)) + ((y1) - (y2))*((y1) - (y2))))
-#define POINTS_PER_INCH        72.0
+#define POINTS_PER_INCH        72
 #define POINTS(f_inch) (ROUND((f_inch)*POINTS_PER_INCH))
-#define PS2INCH(ps)            ((ps)/POINTS_PER_INCH)
+#define PS2INCH(ps)            ((ps)/(double)POINTS_PER_INCH)
 
 #define isPinned(n)     (ND_pinned(n) == P_PIN)
 #define hasPos(n)       (ND_pinned(n) > 0)
index 56fa9f74d178d8506178c5c7a262c54ea5593d72..712992d66a9f56f4ac8ee35501c299fe687eb632 100644 (file)
@@ -127,16 +127,20 @@ void gvrender_begin_job(GVC_t * gvc, char **lib, point pages, double X, double Y
 
     gvc->lib = lib;
     gvc->pages = pages;
-    if (gvre) {
-       /* establish viewport and scaling */
-       if (dpi < 1.0)
+    /* establish viewport and scaling */
+    if (dpi == 0) {
+       if (gvre)
            dpi = gvc->render_features->default_dpi;
-        gvc->dpi = dpi;
-       gvc->width = ROUND(X * dpi / POINTS_PER_INCH);
-       gvc->height = ROUND(Y * dpi / POINTS_PER_INCH);
-       gvc->zoom = Z;              /* scaling factor */
-       gvc->focus.x = x;           /* graph coord of focus - points */
-       gvc->focus.y = y;
+       else
+           dpi = DEFAULT_DPI;
+    }
+    gvc->dpi = dpi;
+    gvc->width = ROUND(X * dpi / POINTS_PER_INCH);
+    gvc->height = ROUND(Y * dpi / POINTS_PER_INCH);
+    gvc->zoom = Z;              /* scaling factor */
+    gvc->focus.x = x;           /* graph coord of focus - points */
+    gvc->focus.y = y;
+    if (gvre) {
         if (gvre->begin_job)
            gvre->begin_job(gvc);
     }
index 613ceef259b8363b068ddab26e3a8c137d60955b..fb2d888fa94030a5c77924304f44ae961f9066c0 100644 (file)
@@ -49,7 +49,7 @@ extern "C" {
     typedef struct {
        int flags;
        int default_margin;
-       double default_dpi;
+       int default_dpi;
        char **knowncolors;
        int sz_knowncolors;
        color_type_t color_type;
@@ -131,7 +131,7 @@ extern "C" {
        color_t bgcolor;        /* background color */
         unsigned int width;
         unsigned int height;
-       double dpi;             /* resolution dots-per-inch */
+       int dpi;                /* resolution dots-per-inch */
        int rot;                /* rotation */
 
        double zoom;            /* viewport zoom factor */
index e6112b51c3ff072feddb2c1397e520f1dc52ca1c..a862a57f06330d0beeacf262e63780092ca56b39 100644 (file)
@@ -1138,7 +1138,8 @@ static int graphcmd(ClientData clientData, Tcl_Interp * interp,
 /* FIXME - nasty hack because memGD is not a language available from command line */
 #if 0
        gvc->job->output_lang =
-           lang_select(gvc, gvc->job->output_langname, 0);
+            gvrender_select(gvc, gvc->job->output_langname);
+
 #else
        gvc->job->output_lang = memGD;
 #endif
@@ -1283,7 +1284,7 @@ static int graphcmd(ClientData clientData, Tcl_Interp * interp,
        }
        /* populate new job struct with output language and output file data */
        gvc->job->output_lang =
-           lang_select(gvc, gvc->job->output_langname, 0);
+            gvrender_select(gvc, gvc->job->output_langname);
        if (Tcl_GetOpenFile
            (interp, argv[2], 1, 1,
             (ClientData *) & (gvc->job->output_file)) != TCL_OK)