Commit 006d3e14 authored by GMT 1999 Andy Thomas's avatar GMT 1999 Andy Thomas Committed by Andy Thomas

app/lc_dialog.c app/nav_window.c app/undo_history.c

Tue Nov  9 21:15:26 GMT 1999 Andy Thomas <alt@gimp.org>

	* app/lc_dialog.c
	* app/nav_window.c
	* app/undo_history.c

	Fixed some rounding errors in the preview images.
parent 8cc45bc7
Tue Nov 9 21:15:26 GMT 1999 Andy Thomas <alt@gimp.org>
* app/lc_dialog.c
* app/nav_window.c
* app/undo_history.c
Fixed some rounding errors in the preview images.
Tue Nov 9 11:33:03 PST 1999 Manish Singh <yosh@gimp.org>
* tools/pdbgen/pdb/drawable.pdb: fix {get,set}_pixel typo reported
......
......@@ -284,16 +284,16 @@ set_size_data (NavWinData *iwd)
pwidth = MIN(sel_width, iwd->nav_preview_width);
/* pheight = sel_height * pwidth / sel_width; */
iwd->ratio = (gdouble)pwidth / ((gdouble)sel_width);
pheight = sel_height * iwd->ratio;
pheight = sel_height * iwd->ratio + 0.5;
iwd->ratio = (gdouble)pheight/(gdouble)sel_height;
pwidth = sel_width * iwd->ratio;
pwidth = sel_width * iwd->ratio + 0.5;
} else {
pheight = MIN(sel_height, iwd->nav_preview_height);
/* pwidth = sel_width * pheight / sel_height; */
iwd->ratio = (gdouble)pheight / ((gdouble)sel_height);
pwidth = sel_width * iwd->ratio;
pwidth = sel_width * iwd->ratio + 0.5;
iwd->ratio = (gdouble)pwidth/(gdouble)sel_width;
pheight = sel_height * iwd->ratio;
pheight = sel_height * iwd->ratio + 0.5;
}
if (gdisp->dot_for_dot)
......
......@@ -284,16 +284,16 @@ set_size_data (NavWinData *iwd)
pwidth = MIN(sel_width, iwd->nav_preview_width);
/* pheight = sel_height * pwidth / sel_width; */
iwd->ratio = (gdouble)pwidth / ((gdouble)sel_width);
pheight = sel_height * iwd->ratio;
pheight = sel_height * iwd->ratio + 0.5;
iwd->ratio = (gdouble)pheight/(gdouble)sel_height;
pwidth = sel_width * iwd->ratio;
pwidth = sel_width * iwd->ratio + 0.5;
} else {
pheight = MIN(sel_height, iwd->nav_preview_height);
/* pwidth = sel_width * pheight / sel_height; */
iwd->ratio = (gdouble)pheight / ((gdouble)sel_height);
pwidth = sel_width * iwd->ratio;
pwidth = sel_width * iwd->ratio + 0.5;
iwd->ratio = (gdouble)pwidth/(gdouble)sel_width;
pheight = sel_height * iwd->ratio;
pheight = sel_height * iwd->ratio + 0.5;
}
if (gdisp->dot_for_dot)
......
......@@ -430,13 +430,13 @@ lc_dialog_fill_preview_with_thumb (GtkWidget *widget,
/* Get right aspect ratio */
if (dwidth > dheight)
{
height = (width * dheight) / dwidth;
width = (dwidth * height) / dheight;
height = (gint)(((gdouble)width * (gdouble)dheight) / (gdouble)dwidth + 0.5);
width = (gint)(((gdouble)dwidth * (gdouble)height) / (gdouble)dheight + 0.5);
}
else
{
width = (height * dwidth) / dheight;
height = (dheight * width) / dwidth;
width = (gint)(((gdouble)height * (gdouble)dwidth) / (gdouble)dheight + 0.5);
height = (gint)(((gdouble)dheight * (gdouble)width) / (gdouble)dwidth + 0.5);
}
buf = gimp_image_construct_composite_preview (gimage, width, height);
......
......@@ -284,16 +284,16 @@ set_size_data (NavWinData *iwd)
pwidth = MIN(sel_width, iwd->nav_preview_width);
/* pheight = sel_height * pwidth / sel_width; */
iwd->ratio = (gdouble)pwidth / ((gdouble)sel_width);
pheight = sel_height * iwd->ratio;
pheight = sel_height * iwd->ratio + 0.5;
iwd->ratio = (gdouble)pheight/(gdouble)sel_height;
pwidth = sel_width * iwd->ratio;
pwidth = sel_width * iwd->ratio + 0.5;
} else {
pheight = MIN(sel_height, iwd->nav_preview_height);
/* pwidth = sel_width * pheight / sel_height; */
iwd->ratio = (gdouble)pheight / ((gdouble)sel_height);
pwidth = sel_width * iwd->ratio;
pwidth = sel_width * iwd->ratio + 0.5;
iwd->ratio = (gdouble)pwidth/(gdouble)sel_width;
pheight = sel_height * iwd->ratio;
pheight = sel_height * iwd->ratio + 0.5;
}
if (gdisp->dot_for_dot)
......
......@@ -262,13 +262,13 @@ undo_history_set_pixmap_idle (gpointer data)
/* Get right aspect ratio */
if (width > height)
{
height = (idle->size * height) / width;
width = (width * height )/ idle->gimage->height;
height = (gint)(((gdouble)idle->size * (gdouble)height) / (gdouble)width + 0.5);
width = (gint)(((gdouble)width * (gdouble)height)/ (gdouble)idle->gimage->height + 0.5);
}
else
{
width = (idle->size * width) / height;
height = (height * width ) / idle->gimage->width;
width = (gint)(((gdouble)idle->size * (gdouble)width) / (gdouble)height + 0.5);
height = (gint)(((gdouble)height * (gdouble)width ) /(gdouble) idle->gimage->width + 0.5);
}
utype = undo_get_undo_top_type(idle->gimage);
......
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