diff --git a/ChangeLog b/ChangeLog index 7f41716fa8..71f541e5c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Aug 23 19:55:48 MEST 1999 Sven Neumann + + * app/measure.c: fixed display of distance in the info window + Mon Aug 23 10:37:24 EDT 1999 Austin Donnelly * gimprc.5.in: add docs for %Dx image-title-format string. diff --git a/app/measure.c b/app/measure.c index bde3311ee5..c01cf21301 100644 --- a/app/measure.c +++ b/app/measure.c @@ -440,8 +440,10 @@ measure_tool_motion (Tool *tool, gimp_unit_get_symbol (gdisp->gimage->unit), _("degrees")); - distance = sqrt (SQR ((double)(ax - bx) / gdisp->gimage->xresolution) + - SQR ((double)(ay - by) / gdisp->gimage->yresolution)); + distance = gimp_unit_get_factor (gdisp->gimage->unit) * + sqrt (SQR ((double)(ax - bx) / gdisp->gimage->xresolution) + + SQR ((double)(ay - by) / gdisp->gimage->yresolution)); + measure_tool->angle1 = measure_get_angle (ax, ay, gdisp->gimage->xresolution, gdisp->gimage->yresolution); @@ -452,8 +454,7 @@ measure_tool_motion (Tool *tool, if (angle > 180.0) angle = fabs (360.0 - angle); - g_snprintf (status_str, STATUSBAR_SIZE, format_str, - distance * gimp_unit_get_factor (gdisp->gimage->unit), angle); + g_snprintf (status_str, STATUSBAR_SIZE, format_str, distance , angle); g_free (format_str); if (measure_tool_options) diff --git a/app/tools/gimpmeasuretool.c b/app/tools/gimpmeasuretool.c index bde3311ee5..c01cf21301 100644 --- a/app/tools/gimpmeasuretool.c +++ b/app/tools/gimpmeasuretool.c @@ -440,8 +440,10 @@ measure_tool_motion (Tool *tool, gimp_unit_get_symbol (gdisp->gimage->unit), _("degrees")); - distance = sqrt (SQR ((double)(ax - bx) / gdisp->gimage->xresolution) + - SQR ((double)(ay - by) / gdisp->gimage->yresolution)); + distance = gimp_unit_get_factor (gdisp->gimage->unit) * + sqrt (SQR ((double)(ax - bx) / gdisp->gimage->xresolution) + + SQR ((double)(ay - by) / gdisp->gimage->yresolution)); + measure_tool->angle1 = measure_get_angle (ax, ay, gdisp->gimage->xresolution, gdisp->gimage->yresolution); @@ -452,8 +454,7 @@ measure_tool_motion (Tool *tool, if (angle > 180.0) angle = fabs (360.0 - angle); - g_snprintf (status_str, STATUSBAR_SIZE, format_str, - distance * gimp_unit_get_factor (gdisp->gimage->unit), angle); + g_snprintf (status_str, STATUSBAR_SIZE, format_str, distance , angle); g_free (format_str); if (measure_tool_options) diff --git a/app/tools/measure.c b/app/tools/measure.c index bde3311ee5..c01cf21301 100644 --- a/app/tools/measure.c +++ b/app/tools/measure.c @@ -440,8 +440,10 @@ measure_tool_motion (Tool *tool, gimp_unit_get_symbol (gdisp->gimage->unit), _("degrees")); - distance = sqrt (SQR ((double)(ax - bx) / gdisp->gimage->xresolution) + - SQR ((double)(ay - by) / gdisp->gimage->yresolution)); + distance = gimp_unit_get_factor (gdisp->gimage->unit) * + sqrt (SQR ((double)(ax - bx) / gdisp->gimage->xresolution) + + SQR ((double)(ay - by) / gdisp->gimage->yresolution)); + measure_tool->angle1 = measure_get_angle (ax, ay, gdisp->gimage->xresolution, gdisp->gimage->yresolution); @@ -452,8 +454,7 @@ measure_tool_motion (Tool *tool, if (angle > 180.0) angle = fabs (360.0 - angle); - g_snprintf (status_str, STATUSBAR_SIZE, format_str, - distance * gimp_unit_get_factor (gdisp->gimage->unit), angle); + g_snprintf (status_str, STATUSBAR_SIZE, format_str, distance , angle); g_free (format_str); if (measure_tool_options)