missed a place that needed the same fix for bug #31098.

2000-12-14  Sven Neumann  <sven@gimp.org>

	* app/nav_window.c: missed a place that needed the same fix for
	bug #31098.
This commit is contained in:
Sven Neumann 2000-12-14 22:29:49 +00:00 committed by Sven Neumann
parent 909d0ffa2e
commit b44620a31b
4 changed files with 41 additions and 57 deletions

View File

@ -1,3 +1,8 @@
2000-12-14 Sven Neumann <sven@gimp.org>
* app/nav_window.c: missed a place that needed the same fix for
bug #31098.
2000-12-14 Sven Neumann <sven@gimp.org>
* app/commands.c (image_resize_callback):

View File

@ -324,7 +324,7 @@ set_size_data (NavWinData *iwd)
iwd->ratio = MIN (1.0, (gdouble) pheight / (gdouble) sel_height);
}
pwidth = sel_width * iwd->ratio + 0.5;
pwidth = sel_width * iwd->ratio + 0.5;
pheight = sel_height * iwd->ratio + 0.5;
iwd->pwidth = pwidth;
@ -344,7 +344,7 @@ create_preview_widget (NavWinData *iwd)
hbox = gtk_hbox_new (FALSE,0);
iwd->previewBox = hbox;
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (iwd->previewAlign),hbox);
gtk_container_add (GTK_CONTAINER (iwd->previewAlign), hbox);
image = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_widget_set_events (GTK_WIDGET(image), PREVIEW_MASK);
@ -403,7 +403,7 @@ update_real_view (NavWinData *iwd,
xratio = SCALEFACTOR_X (gdisp);
yratio = SCALEFACTOR_Y (gdisp);
if((tx + iwd->dispwidth) >= iwd->pwidth)
if ((tx + iwd->dispwidth) >= iwd->pwidth)
{
tx = iwd->pwidth; /* Actually should be less...
* but bound check will save us.
@ -412,7 +412,7 @@ update_real_view (NavWinData *iwd,
xpnt = (gint) (((gdouble) (tx) * xratio) / iwd->ratio + 0.5);
if((ty + iwd->dispheight) >= iwd->pheight)
if ((ty + iwd->dispheight) >= iwd->pheight)
ty = iwd->pheight; /* Same comment as for xpnt above. */
ypnt = (gint) (((gdouble) (ty) * yratio) / iwd->ratio + 0.5);
@ -466,21 +466,14 @@ nav_window_update_preview (NavWinData *iwd)
gdouble tratio;
if (sel_width > sel_height)
{
pwidth = iwd->nav_preview_width;
tratio = (gdouble) pwidth / ((gdouble) sel_width);
pheight = sel_height * tratio + 0.5;
tratio = (gdouble) pheight / (gdouble) sel_height;
pwidth = sel_width * tratio + 0.5;
}
else
{
pheight = iwd->nav_preview_height;
tratio = (gdouble) pheight / ((gdouble) sel_height);
pwidth = sel_width * tratio + 0.5;
tratio = (gdouble) pwidth / (gdouble) sel_width;
pheight = sel_height * tratio + 0.5;
}
tratio =
MIN (1.0, (gdouble) iwd->nav_preview_width / ((gdouble) sel_width));
else
tratio =
MIN (1.0, (gdouble) iwd->nav_preview_height / ((gdouble) sel_height));
pwidth = sel_width * tratio + 0.5;
pheight = sel_height * tratio + 0.5;
}
preview_buf = gimp_image_construct_composite_preview (gimage,

View File

@ -324,7 +324,7 @@ set_size_data (NavWinData *iwd)
iwd->ratio = MIN (1.0, (gdouble) pheight / (gdouble) sel_height);
}
pwidth = sel_width * iwd->ratio + 0.5;
pwidth = sel_width * iwd->ratio + 0.5;
pheight = sel_height * iwd->ratio + 0.5;
iwd->pwidth = pwidth;
@ -344,7 +344,7 @@ create_preview_widget (NavWinData *iwd)
hbox = gtk_hbox_new (FALSE,0);
iwd->previewBox = hbox;
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (iwd->previewAlign),hbox);
gtk_container_add (GTK_CONTAINER (iwd->previewAlign), hbox);
image = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_widget_set_events (GTK_WIDGET(image), PREVIEW_MASK);
@ -403,7 +403,7 @@ update_real_view (NavWinData *iwd,
xratio = SCALEFACTOR_X (gdisp);
yratio = SCALEFACTOR_Y (gdisp);
if((tx + iwd->dispwidth) >= iwd->pwidth)
if ((tx + iwd->dispwidth) >= iwd->pwidth)
{
tx = iwd->pwidth; /* Actually should be less...
* but bound check will save us.
@ -412,7 +412,7 @@ update_real_view (NavWinData *iwd,
xpnt = (gint) (((gdouble) (tx) * xratio) / iwd->ratio + 0.5);
if((ty + iwd->dispheight) >= iwd->pheight)
if ((ty + iwd->dispheight) >= iwd->pheight)
ty = iwd->pheight; /* Same comment as for xpnt above. */
ypnt = (gint) (((gdouble) (ty) * yratio) / iwd->ratio + 0.5);
@ -466,21 +466,14 @@ nav_window_update_preview (NavWinData *iwd)
gdouble tratio;
if (sel_width > sel_height)
{
pwidth = iwd->nav_preview_width;
tratio = (gdouble) pwidth / ((gdouble) sel_width);
pheight = sel_height * tratio + 0.5;
tratio = (gdouble) pheight / (gdouble) sel_height;
pwidth = sel_width * tratio + 0.5;
}
else
{
pheight = iwd->nav_preview_height;
tratio = (gdouble) pheight / ((gdouble) sel_height);
pwidth = sel_width * tratio + 0.5;
tratio = (gdouble) pwidth / (gdouble) sel_width;
pheight = sel_height * tratio + 0.5;
}
tratio =
MIN (1.0, (gdouble) iwd->nav_preview_width / ((gdouble) sel_width));
else
tratio =
MIN (1.0, (gdouble) iwd->nav_preview_height / ((gdouble) sel_height));
pwidth = sel_width * tratio + 0.5;
pheight = sel_height * tratio + 0.5;
}
preview_buf = gimp_image_construct_composite_preview (gimage,

View File

@ -324,7 +324,7 @@ set_size_data (NavWinData *iwd)
iwd->ratio = MIN (1.0, (gdouble) pheight / (gdouble) sel_height);
}
pwidth = sel_width * iwd->ratio + 0.5;
pwidth = sel_width * iwd->ratio + 0.5;
pheight = sel_height * iwd->ratio + 0.5;
iwd->pwidth = pwidth;
@ -344,7 +344,7 @@ create_preview_widget (NavWinData *iwd)
hbox = gtk_hbox_new (FALSE,0);
iwd->previewBox = hbox;
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (iwd->previewAlign),hbox);
gtk_container_add (GTK_CONTAINER (iwd->previewAlign), hbox);
image = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_widget_set_events (GTK_WIDGET(image), PREVIEW_MASK);
@ -403,7 +403,7 @@ update_real_view (NavWinData *iwd,
xratio = SCALEFACTOR_X (gdisp);
yratio = SCALEFACTOR_Y (gdisp);
if((tx + iwd->dispwidth) >= iwd->pwidth)
if ((tx + iwd->dispwidth) >= iwd->pwidth)
{
tx = iwd->pwidth; /* Actually should be less...
* but bound check will save us.
@ -412,7 +412,7 @@ update_real_view (NavWinData *iwd,
xpnt = (gint) (((gdouble) (tx) * xratio) / iwd->ratio + 0.5);
if((ty + iwd->dispheight) >= iwd->pheight)
if ((ty + iwd->dispheight) >= iwd->pheight)
ty = iwd->pheight; /* Same comment as for xpnt above. */
ypnt = (gint) (((gdouble) (ty) * yratio) / iwd->ratio + 0.5);
@ -466,21 +466,14 @@ nav_window_update_preview (NavWinData *iwd)
gdouble tratio;
if (sel_width > sel_height)
{
pwidth = iwd->nav_preview_width;
tratio = (gdouble) pwidth / ((gdouble) sel_width);
pheight = sel_height * tratio + 0.5;
tratio = (gdouble) pheight / (gdouble) sel_height;
pwidth = sel_width * tratio + 0.5;
}
else
{
pheight = iwd->nav_preview_height;
tratio = (gdouble) pheight / ((gdouble) sel_height);
pwidth = sel_width * tratio + 0.5;
tratio = (gdouble) pwidth / (gdouble) sel_width;
pheight = sel_height * tratio + 0.5;
}
tratio =
MIN (1.0, (gdouble) iwd->nav_preview_width / ((gdouble) sel_width));
else
tratio =
MIN (1.0, (gdouble) iwd->nav_preview_height / ((gdouble) sel_height));
pwidth = sel_width * tratio + 0.5;
pheight = sel_height * tratio + 0.5;
}
preview_buf = gimp_image_construct_composite_preview (gimage,