applied patch from Shlomi Fish that fixes a number of bugs in the

2004-07-05  Sven Neumann  <sven@gimp.org>

	* plug-ins/gimpressionist: applied patch from Shlomi Fish that
	fixes a number of bugs in the gimpressionst plug-in (bug #145309).

	Also added some const qualifiers, cleaned up includes and removed
	degtorad() and radtodeg() functions that used to duplicate
	functionality from libgimpmath.
This commit is contained in:
Sven Neumann 2004-07-05 16:50:46 +00:00 committed by Sven Neumann
parent 49a46c76a0
commit afe4ff8290
20 changed files with 240 additions and 222 deletions

View File

@ -1,3 +1,12 @@
2004-07-05 Sven Neumann <sven@gimp.org>
* plug-ins/gimpressionist: applied patch from Shlomi Fish that
fixes a number of bugs in the gimpressionst plug-in (bug #145309).
Also added some const qualifiers, cleaned up includes and removed
degtorad() and radtodeg() functions that used to duplicate
functionality from libgimpmath.
2004-07-05 Michael Natterer <mitch@gimp.org>
* app/widgets/gimptemplateview.c

View File

@ -28,10 +28,11 @@ libexec_PROGRAMS = gimpressionist
gimpressionist_sources = \
brush.c \
color.h \
brush.h \
color.c \
general.h \
color.h \
general.c \
general.h \
gimp.c \
gimpressionist.c \
gimpressionist.h \
@ -39,8 +40,8 @@ gimpressionist_sources = \
orientation.c \
orientmap.c \
paper.c \
placement.h \
placement.c \
placement.h \
plasma.c \
ppmtool.c \
ppmtool.h \

View File

@ -1,14 +1,8 @@
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED
#endif
@ -24,6 +18,7 @@
#include "gimpressionist.h"
#include "ppmtool.h"
#include "brush.h"
#include <libgimp/stdplugins-intl.h>
@ -38,6 +33,8 @@ static GtkObject *brushreliefadjust = NULL;
static GtkObject *brushaspectadjust = NULL;
static GtkObject *brushgammaadjust = NULL;
static gchar *last_selected_brush = NULL;
void brush_restore(void)
{
reselect (brushlist, pcvals.selectedbrush);
@ -51,6 +48,11 @@ void brush_store(void)
pcvals.brushgamma = GTK_ADJUSTMENT(brushgammaadjust)->value;
}
void brush_free(void)
{
g_free (last_selected_brush);
}
static void updatebrushprev (const char *fn);
static gboolean file_is_color (const char *fn)
@ -339,22 +341,41 @@ selectbrush (GtkTreeSelection *selection, gpointer data)
{
GtkTreeIter iter;
GtkTreeModel *model;
gchar *fname = NULL;
gchar *brush = NULL;
if (brushdontupdate)
return;
goto cleanup;
if (brushfile == 0)
{
updatebrushprev (NULL);
return;
goto cleanup;
}
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
gchar *brush;
gtk_tree_model_get (model, &iter, 0, &brush, -1);
/* Check if the same brush was selected twice, and if so
* break. Otherwise, the brush gamma and stuff would have been
* reset.
* */
if (last_selected_brush == NULL)
{
last_selected_brush = g_strdup(brush);
}
else
{
if (!strcmp (last_selected_brush, brush))
goto cleanup;
else
{
g_free (last_selected_brush);
last_selected_brush = g_strdup(brush);
}
}
brushdontupdate = TRUE;
gtk_adjustment_set_value(GTK_ADJUSTMENT(brushgammaadjust), 1.0);
gtk_adjustment_set_value(GTK_ADJUSTMENT(brushaspectadjust), 0.0);
@ -362,17 +383,20 @@ selectbrush (GtkTreeSelection *selection, gpointer data)
if (brush)
{
gchar *fname = g_build_filename ("Brushes", brush, NULL);
fname = g_build_filename ("Brushes", brush, NULL);
g_strlcpy (pcvals.selectedbrush,
fname, sizeof (pcvals.selectedbrush));
updatebrushprev (fname);
}
}
cleanup:
g_free (fname);
g_free (brush);
}
}
return;
}
static void
@ -517,5 +541,11 @@ create_brushpage(GtkNotebook *notebook)
selectbrush(selection, NULL);
readdirintolist("Brushes", view, pcvals.selectedbrush);
/*
* This is so the "changed signal won't get sent to the brushes' list
* and reset the gamma and stuff.
* */
gtk_widget_grab_focus (brushlist);
gtk_notebook_append_page_menu (notebook, thispage, label, NULL);
}

View File

@ -0,0 +1,8 @@
#ifndef __BRUSH_H
#define __BRUSH_H
void brush_store(void);
void brush_restore(void);
void brush_free(void);
#endif /* #ifndef __BRUSH_H */

View File

@ -1,9 +1,5 @@
#include "config.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
@ -22,10 +18,8 @@ static GtkWidget *colorradio[NUMCOLORRADIO];
void color_type_restore(void)
{
gtk_toggle_button_set_active (
GTK_TOGGLE_BUTTON(colorradio[pcvals.colortype]),
TRUE
);
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON(colorradio[pcvals.colortype]), TRUE);
}
void create_colorpage(GtkNotebook *notebook)

View File

@ -1,9 +1,6 @@
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <gtk/gtk.h>
@ -12,6 +9,7 @@
#include "ppmtool.h"
#include "gimpressionist.h"
#include "preview.h"
#include "brush.h"
#include "libgimp/stdplugins-intl.h"
@ -80,7 +78,7 @@ run (const gchar *name,
GimpRunMode run_mode;
GimpPDBStatusType status;
gboolean with_specified_preset;
gchar *preset_name;
gchar *preset_name = NULL;
status = GIMP_PDB_SUCCESS;
run_mode = param[0].data.d_int32;
@ -178,6 +176,7 @@ run (const gchar *name,
free_parsepath_cache();
reloadbrush(NULL, NULL);
preview_free_resources();
brush_free();
values[0].data.d_status = status;

View File

@ -1,13 +1,5 @@
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
@ -15,6 +7,7 @@
/*
* The Page Specific Imports
* */
#include "brush.h"
#include "color.h"
#include "general.h"
#include "placement.h"
@ -242,6 +235,12 @@ create_dialog (void)
updatepreview (NULL, 0);
/*
* This is to make sure the values from the pcvals will be reflected
* in the GUI here. Otherwise they will be set to the defaults.
* */
restorevals ();
gtk_widget_show (dlg);
return dlg;

View File

@ -160,8 +160,6 @@ void readdirintolist(char *subdir, GtkWidget *view, char *selected);
void orientation_restore(void);
void paper_store(void);
void paper_restore(void);
void brush_store(void);
void brush_restore(void);
GtkWidget *createonecolumnlist(GtkWidget *parent,
void (*changed_cb)
@ -184,12 +182,10 @@ enum SELECT_PRESET_RETURN_VALUES
SELECT_PRESET_LOAD_FAILED = -2,
};
int select_preset(char * preset);
int select_preset(const gchar *preset);
void set_colorbrushes (const gchar *fn);
int create_gimpressionist (void);
double degtorad(double d);
double radtodeg(double d);
double dist(double x, double y, double dx, double dy);
void restore_default_values(void);

View File

@ -1,13 +1,5 @@
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
#include <libgimp/gimp.h>

View File

@ -1,10 +1,5 @@
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED
#endif
@ -125,7 +120,7 @@ double getdir(double x, double y, int from)
}
dx = dx / sum;
dy = dy / sum;
return 90-(radtodeg(atan2(dy,dx))+angoff);
return 90-(gimp_rad_to_deg(atan2(dy,dx))+angoff);
}
static void updateompreviewprev(void)
@ -143,7 +138,7 @@ static void updateompreviewprev(void)
for(y = 6; y < OMHEIGHT-4; y += 10)
for(x = 6; x < OMWIDTH-4; x += 10) {
double dir = degtorad(getdir(x/(double)OMWIDTH,y/(double)OMHEIGHT,0));
double dir = gimp_deg_to_rad(getdir(x/(double)OMWIDTH,y/(double)OMHEIGHT,0));
double xo = sin(dir)*4.0;
double yo = cos(dir)*4.0;
drawline(&nbuffer, x-xo, y-yo, x+xo, y+yo, gray);
@ -193,8 +188,8 @@ static void updatevectorprev(void)
double s;
x = vector[i].x * OMWIDTH;
y = vector[i].y * OMHEIGHT;
dir = degtorad(vector[i].dir);
s = degtorad(vector[i].str);
dir = gimp_deg_to_rad(vector[i].dir);
s = gimp_deg_to_rad(vector[i].str);
xo = sin(dir)*(6.0+100*s);
yo = cos(dir)*(6.0+100*s);
if(i == selectedvector)
@ -246,8 +241,8 @@ static void add_new_vector (gdouble x, gdouble y)
vector[numvect].x = x;
vector[numvect].y = y;
vector[numvect].dir = 0.0;
vector[numvect].dx = sin(degtorad(0.0));
vector[numvect].dy = cos(degtorad(0.0));
vector[numvect].dx = sin(gimp_deg_to_rad(0.0));
vector[numvect].dy = cos(gimp_deg_to_rad(0.0));
vector[numvect].str = 1.0;
vector[numvect].type = 0;
selectedvector = numvect;
@ -292,7 +287,7 @@ static void mapclick(GtkWidget *w, GdkEventButton *event)
double d;
d = atan2(OMWIDTH * vector[selectedvector].x - event->x,
OMHEIGHT * vector[selectedvector].y - event->y);
vector[selectedvector].dir = radtodeg(d);
vector[selectedvector].dir = gimp_rad_to_deg(d);
vector[selectedvector].dx = sin(d);
vector[selectedvector].dy = cos(d);
updatesliders();
@ -305,8 +300,8 @@ static void angadjmove(GtkWidget *w, gpointer data)
{
if (adjignore) return;
vector[selectedvector].dir = GTK_ADJUSTMENT(angadjust)->value;
vector[selectedvector].dx = sin(degtorad(vector[selectedvector].dir));
vector[selectedvector].dy = cos(degtorad(vector[selectedvector].dir));
vector[selectedvector].dx = sin(gimp_deg_to_rad(vector[selectedvector].dir));
vector[selectedvector].dy = cos(gimp_deg_to_rad(vector[selectedvector].dir));
updatevectorprev();
updateompreviewprev();
}

View File

@ -1,11 +1,6 @@
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED

View File

@ -1,12 +1,5 @@
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
#include <libgimp/gimp.h>

View File

@ -1,11 +1,10 @@
#include "config.h"
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <gtk/gtk.h>
#include <libgimpmath/gimpmath.h>
#include <libgimp/gimp.h>
#include "gimpressionist.h"

View File

@ -3,14 +3,11 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
#include <libgimpmath/gimpmath.h>
#include <libgimp/gimp.h>
#include "ppmtool.h"

View File

@ -3,6 +3,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@ -16,16 +18,25 @@
#include "libgimp/stdplugins-intl.h"
#ifdef G_OS_WIN32
#include "libgimpbase/gimpwin32-io.h"
#endif
static GtkWidget *presetnameentry = NULL;
static GtkWidget *presetlist = NULL;
static GtkWidget *presetdesclabel = NULL;
static GtkListStore *store;
static void set_preset_description_text (const gchar *text)
{
gtk_label_set_text (GTK_LABEL (presetdesclabel), text);
}
static char presetdesc[4096] = "";
static char *factory_defaults = "<Factory defaults>";
static void addfactorydefaults(void)
static void addfactorydefaults (void)
{
GtkTreeIter iter;
@ -42,7 +53,7 @@ static void presetsrefresh(void)
#define PRESETMAGIC "Preset"
static int loadoldpreset(char *fname)
static int loadoldpreset (const gchar *fname)
{
FILE *f;
int len;
@ -58,7 +69,7 @@ static int loadoldpreset(char *fname)
return 0;
}
static unsigned int hexval(char c)
static unsigned int hexval (char c)
{
c = g_ascii_tolower (c);
if((c >= 'a') && (c <= 'f')) return c - 'a' + 10;
@ -66,7 +77,7 @@ static unsigned int hexval(char c)
return 0;
}
static char *parsergbstring(char *s)
static char *parsergbstring (const gchar *s)
{
static char col[3];
col[0] = (hexval(s[0]) << 4) | hexval(s[1]);
@ -75,9 +86,9 @@ static char *parsergbstring(char *s)
return col;
}
static void setorientvector(char *str)
static void setorientvector (const gchar *str)
{
char *tmps = str;
const gchar *tmps = str;
int n;
n = atoi(tmps);
@ -105,9 +116,9 @@ static void setorientvector(char *str)
}
static void setsizevector(char *str)
static void setsizevector (const gchar *str)
{
char *tmps = str;
const gchar *tmps = str;
int n;
n = atoi(tmps);
@ -126,7 +137,7 @@ static void setsizevector(char *str)
}
static void parsedesc(char *str, char *d, gssize d_len)
static void parsedesc (const gchar *str, gchar *d, gssize d_len)
{
gchar *dest = g_strcompress (str);
@ -135,7 +146,7 @@ static void parsedesc(char *str, char *d, gssize d_len)
g_free (dest);
}
static void setval(char *key, char *val)
static void setval (const gchar *key, const gchar *val)
{
if(!strcmp(key, "desc"))
parsedesc(val, presetdesc, sizeof (presetdesc));
@ -240,7 +251,7 @@ static void setval(char *key, char *val)
pcvals.colornoise = g_ascii_strtod (val, NULL);
}
static int loadpreset(char *fn)
static int loadpreset(const gchar *fn)
{
char line[1024] = "";
FILE *f;
@ -272,7 +283,7 @@ static int loadpreset(char *fn)
return 0;
}
int select_preset(char * preset)
int select_preset(const gchar *preset)
{
int ret = SELECT_PRESET_OK;
/* I'm copying this behavior as is. As it seems applying the
@ -307,6 +318,7 @@ int select_preset(char * preset)
* */
set_colorbrushes (pcvals.selectedbrush);
}
return ret;
}
@ -364,14 +376,12 @@ static void savepreset(void);
static void presetdesccallback(GtkTextBuffer *buffer, gpointer data)
{
char *dest, *str;
char *str;
GtkTextIter start, end;
gtk_text_buffer_get_bounds (buffer, &start, &end);
str = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
dest = g_strescape (str, NULL);
g_strlcpy (presetdesc, dest, sizeof (presetdesc));
g_free (dest);
g_strlcpy (presetdesc, str, sizeof (presetdesc));
g_free (str);
}
@ -451,13 +461,14 @@ create_savepreset (void)
static void savepreset(void)
{
const gchar *l;
gchar *fname;
gchar *fname, *presets_dir_path;
FILE *f;
GList *thispath;
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
gchar vbuf[6][G_ASCII_DTOSTR_BUF_SIZE];
guchar color[3];
gint i;
gchar *desc_escaped;
l = gtk_entry_get_text (GTK_ENTRY (presetnameentry));
thispath = parsepath ();
@ -469,17 +480,39 @@ static void savepreset(void)
return;
}
fname = g_build_filename ((char *)thispath->data, "Presets", l, NULL);
/* Create the ~/.gimp-$VER/gimpressionist/Presets directory if
* it doesn't already exists.
* */
presets_dir_path = g_build_filename ((char *)thispath->data, "Presets", NULL);
if (!g_file_test (presets_dir_path, G_FILE_TEST_IS_DIR))
{
if (mkdir (presets_dir_path,
S_IRUSR | S_IWUSR | S_IXUSR |
S_IRGRP | S_IXGRP |
S_IROTH | S_IXOTH) == -1)
{
g_printerr ("Error creating folder \"%s\"!\n", presets_dir_path);
g_free (presets_dir_path);
return;
}
}
fname = g_build_filename (presets_dir_path, l, NULL);
g_free (presets_dir_path);
f = fopen (fname, "wt");
if (!f)
{
g_printerr ("Error opening file \"%s\" for writing!%c\n", fname, 7);
g_free (fname);
return;
}
fprintf(f, "%s\n", PRESETMAGIC);
fprintf(f, "desc=%s\n", presetdesc);
desc_escaped = g_strescape (presetdesc, NULL);
fprintf(f, "desc=%s\n", desc_escaped);
g_free (desc_escaped);
fprintf(f, "orientnum=%d\n", pcvals.orientnum);
fprintf(f, "orientfirst=%s\n",
g_ascii_formatd (buf, G_ASCII_DTOSTR_BUF_SIZE, "%f", pcvals.orientfirst));
@ -590,7 +623,7 @@ static void readdesc(const char *fn)
if (!fname)
{
gtk_label_set_text (GTK_LABEL (presetdesclabel), "");
set_preset_description_text("");
return;
}
@ -606,7 +639,7 @@ static void readdesc(const char *fn)
if (!strncmp (line, "desc=", 5))
{
parsedesc (line + 5, tmplabel, sizeof (tmplabel));
gtk_label_set_text (GTK_LABEL (presetdesclabel), tmplabel);
set_preset_description_text (tmplabel);
fclose (f);
return;
}
@ -614,7 +647,7 @@ static void readdesc(const char *fn)
fclose (f);
}
gtk_label_set_text (GTK_LABEL (presetdesclabel), "");
set_preset_description_text ("");
}
static void selectpreset(GtkTreeSelection *selection, gpointer data)
@ -705,6 +738,13 @@ void create_presetpage(GtkNotebook *notebook)
gimp_help_set_help_data (tmpw, _("Reread the folder of Presets"), NULL);
presetdesclabel = tmpw = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (tmpw), TRUE);
/*
* Make sure the label's width is reasonable and it won't stretch
* the dialog more than its width.
* */
gtk_widget_set_size_request (tmpw, 200, -1);
gtk_misc_set_alignment (GTK_MISC (tmpw), 0.0, 0.0);
gtk_box_pack_start(GTK_BOX (vbox), tmpw, TRUE, TRUE, 0);
gtk_widget_show(tmpw);

View File

@ -1,9 +1,6 @@
#include "config.h"
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED

View File

@ -1,16 +1,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#define HAVE_DIRENT_H
#define HAVE_UNISTD_H
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
@ -165,7 +156,7 @@ static int bestbrush(ppm_t *p, ppm_t *a, int tx, int ty,
}
if(!brlist) {
fprintf(stderr, "What!? No brushes?!\n");
g_printerr("What!? No brushes?!\n");
return 0;
}
@ -299,7 +290,7 @@ void repaint(ppm_t *p, ppm_t *a)
/* Shouldn't be necessary, but... */
if(img_has_alpha)
if((p->width != a->width) || (p->height != a->height)) {
fprintf(stderr, "Huh? Image size != alpha size?\n");
g_printerr("Huh? Image size != alpha size?\n");
return;
}
@ -363,7 +354,7 @@ void repaint(ppm_t *p, ppm_t *a)
#if 0
for(i = 0; i < numbrush; i++) {
char tmp[1000];
sprintf(tmp, "/tmp/_brush%03d.ppm", i);
g_snprintf (tmp, sizeof (tmp), "/tmp/_brush%03d.ppm", i);
saveppm(&brushes[i], tmp);
}
#endif
@ -618,7 +609,7 @@ void repaint(ppm_t *p, ppm_t *a)
(int)(tmp.height * density / maxbrushheight);
step = i;
#if 0
fprintf(stderr, "step=%d i=%d\n", step, i);
g_printerr("step=%d i=%d\n", step, i);
#endif
}
if(i < 1) i = 1;
@ -651,7 +642,8 @@ void repaint(ppm_t *p, ppm_t *a)
gimp_progress_update(0.8 - 0.8*((double)i / max_progress));
} else {
char tmps[40];
sprintf(tmps, "%.1f %%", 100 * (1.0 - ((double)i / max_progress)));
g_snprintf (tmps, sizeof (tmps),
"%.1f %%", 100 * (1.0 - ((double)i / max_progress)));
gtk_label_set_text(GTK_LABEL(GTK_BIN(previewbutton)->child), tmps);
while(gtk_events_pending())
gtk_main_iteration();
@ -677,7 +669,7 @@ void repaint(ppm_t *p, ppm_t *a)
(tx + maxbrushwidth/2 >= p->width) ||
(ty + maxbrushheight/2 >= p->height)) {
#if 0
fprintf(stderr, "Internal Error; invalid coords: (%d,%d) i=%d\n", tx, ty, i);
g_printerr("Internal Error; invalid coords: (%d,%d) i=%d\n", tx, ty, i);
#endif
continue;
}
@ -704,7 +696,7 @@ void repaint(ppm_t *p, ppm_t *a)
case ORIENTATION_ADAPTIVE:
break; /* Handled below */
default:
fprintf(stderr, "Internal error; Unknown orientationtype\n");
g_printerr("Internal error; Unknown orientationtype\n");
on = 0;
break;
}
@ -724,7 +716,7 @@ void repaint(ppm_t *p, ppm_t *a)
case SIZE_TYPE_ADAPTIVE:
break; /* Handled below */
default:
fprintf(stderr, "Internal error; Unknown sizetype\n");
g_printerr("Internal error; Unknown sizetype\n");
sn = 0;
break;
}

View File

@ -1,12 +1,5 @@
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <gtk/gtk.h>
#include <libgimp/gimp.h>

View File

@ -1,10 +1,5 @@
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#ifdef __GNUC__
#warning GTK_DISABLE_DEPRECATED
#endif

View File

@ -2,27 +2,20 @@
* utils.c - various utility routines that don't fit anywhere else. Usually
* these routines don't affect the state of the program.
* */
#include <math.h>
#include "config.h"
#include <string.h>
#include <glib.h>
#include <libgimpmath/gimpmath.h>
#include "gimpressionist.h"
#include "config.h"
#include "libgimp/stdplugins-intl.h"
/* Mathematical Utilities */
double degtorad(double d)
{
return d/180.0*G_PI;
}
double radtodeg(double d)
{
double v = d/G_PI*180.0;
if(v < 0.0) v += 360;
return v;
}
double dist(double x, double y, double end_x, double end_y)
{
double dx = end_x - x;
@ -37,7 +30,8 @@ double getsiz_proto (double x, double y, int n, smvector_t *vec,
double sum, ssum, dst;
int first = 0, last;
if((x < 0.0) || (x > 1.0)) printf("HUH? x = %f\n",x);
if ((x < 0.0) || (x > 1.0))
g_warning ("HUH? x = %f\n",x);
#if 0
if (from == 0)