Issue #2635 - Segfault when using measuring tool
In gimp_tool_compass_update_angle(), use fuzzy comparisson when
determining whether to update the angle properties, to avoid
infinite recursion due to floating-point inaccuracies. In
partcicular, on x86, when using the x87 FPU rather than SSE, the
floating-point registers are 80-bit, while the properties are
stored as 64-bit, which can create small discrepancies between the
calculated angles and the stored values.
(cherry picked from commit ad831dbc6d
)
This commit is contained in:
@ -1155,14 +1155,14 @@ gimp_tool_compass_update_angle (GimpToolCompass *compass,
|
||||
}
|
||||
}
|
||||
|
||||
if (pixel_angle != private->pixel_angle)
|
||||
if (fabs (pixel_angle - private->pixel_angle) > EPSILON)
|
||||
{
|
||||
private->pixel_angle = pixel_angle;
|
||||
|
||||
g_object_notify (G_OBJECT (compass), "pixel-angle");
|
||||
}
|
||||
|
||||
if (unit_angle != private->unit_angle)
|
||||
if (fabs (unit_angle - private->unit_angle) > EPSILON)
|
||||
{
|
||||
private->unit_angle = unit_angle;
|
||||
|
||||
|
Reference in New Issue
Block a user