Commit bfa52ab7 authored by Shlomi Fish's avatar Shlomi Fish
Browse files

added a de-allocation to the PPM's allocated by the size map dialog.

* plug-ins/gimpressionist/: added a de-allocation to the PPM's
allocated by the size map dialog.
parent 8eec57e3
2004-07-26 Shlomi Fish <shlomif@iglu.org.il>
* plug-ins/gimpressionist/: added a de-allocation to the PPM's
allocated by the size map dialog.
2004-07-26 Sven Neumann <sven@gimp.org>
* app/core/gimpgradient-load.c: load all linear gradients from an
......
......@@ -14,6 +14,7 @@
#include "presets.h"
#include "random.h"
#include "orientmap.h"
#include "size.h"
#include "libgimp/stdplugins-intl.h"
......@@ -202,6 +203,7 @@ run (const gchar *name,
brush_free();
preset_free();
orientation_map_free_resources();
size_map_free_resources();
values[0].data.d_status = status;
......
......@@ -18,5 +18,6 @@ void size_restore (void);
void create_sizepage (GtkNotebook *);
int size_type_input (int in);
void size_map_free_resources ();
#endif /* #ifndef __SIZE_H */
......@@ -87,11 +87,11 @@ static void updatesmpreviewprev(void)
}
static gint selectedsmvector = 0;
static ppm_t update_vector_preview_backup = {0,0,NULL};
static ppm_t update_vector_preview_sbuffer = {0,0,NULL};
static void updatesmvectorprev(void)
{
static ppm_t backup = {0,0,NULL};
static ppm_t sbuffer = {0,0,NULL};
static int ok = 0;
gint i, x, y;
gdouble val;
......@@ -110,16 +110,17 @@ static void updatesmvectorprev(void)
#if 0
if (!PPM_IS_INITED (&infile))
updatepreview (NULL, (void *)2); /* Force grabarea() */
ppm_copy(&infile, &backup);
ppm_copy(&infile, &update_vector_preview_backup);
#else
infile_copy_to_ppm (&backup);
infile_copy_to_ppm (&update_vector_preview_backup);
#endif
ppm_apply_brightness(&backup, val, 1,1,1);
if (backup.width != OMWIDTH || backup.height != OMHEIGHT)
resize_fast(&backup, OMWIDTH, OMHEIGHT);
ppm_apply_brightness(&update_vector_preview_backup, val, 1,1,1);
if (update_vector_preview_backup.width != OMWIDTH ||
update_vector_preview_backup.height != OMHEIGHT)
resize_fast(&update_vector_preview_backup, OMWIDTH, OMHEIGHT);
ok = 1;
}
ppm_copy(&backup, &sbuffer);
ppm_copy(&update_vector_preview_backup, &update_vector_preview_sbuffer);
for (i = 0; i < numsmvect; i++)
{
......@@ -127,20 +128,21 @@ static void updatesmvectorprev(void)
y = smvector[i].y * OMHEIGHT;
if (i == selectedsmvector)
{
ppm_drawline (&sbuffer, x-5, y, x+5, y, red);
ppm_drawline (&sbuffer, x, y-5, x, y+5, red);
ppm_drawline (&update_vector_preview_sbuffer, x-5, y, x+5, y, red);
ppm_drawline (&update_vector_preview_sbuffer, x, y-5, x, y+5, red);
}
else
{
ppm_drawline (&sbuffer, x-5, y, x+5, y, gray);
ppm_drawline (&sbuffer, x, y-5, x, y+5, gray);
ppm_drawline (&update_vector_preview_sbuffer, x-5, y, x+5, y, gray);
ppm_drawline (&update_vector_preview_sbuffer, x, y-5, x, y+5, gray);
}
ppm_put_rgb (&sbuffer, x, y, white);
ppm_put_rgb (&update_vector_preview_sbuffer, x, y, white);
}
for (y = 0; y < OMHEIGHT; y++)
gtk_preview_draw_row (GTK_PREVIEW(smvectorprev),
sbuffer.col + y * sbuffer.width * 3,
update_vector_preview_sbuffer.col +
y * update_vector_preview_sbuffer.width * 3,
0, y, OMWIDTH);
gtk_widget_queue_draw (smvectorprev);
......@@ -151,6 +153,12 @@ static void updatesmvectorprev(void)
gtk_widget_set_sensitive (kill_button, (numsmvect > 1));
}
void size_map_free_resources ()
{
ppm_kill (&update_vector_preview_backup);
ppm_kill (&update_vector_preview_sbuffer);
}
static gboolean smadjignore = FALSE;
static void updatesmsliders(void)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment