fixed display of distance in the info window

--Sven
This commit is contained in:
Sven Neumann 1999-08-23 17:58:01 +00:00
parent 3379feb8ec
commit bb59f41a93
4 changed files with 19 additions and 12 deletions

View File

@ -1,3 +1,7 @@
Mon Aug 23 19:55:48 MEST 1999 Sven Neumann <sven@gimp.org>
* app/measure.c: fixed display of distance in the info window
Mon Aug 23 10:37:24 EDT 1999 Austin Donnelly <austin@gimp.org>
* gimprc.5.in: add docs for %Dx image-title-format string.

View File

@ -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)

View File

@ -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)

View File

@ -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)