Fixed the handling of printed units when "units grid" is used. The
original implementation (which was added recently) used an inverted output scale and multiplied by it instead of dividing by it, resulting in incorrect units. However, it was not even getting to that point due to the use of uninitialized variable "crec", which should have been set from the window pointer but was missing.
This commit is contained in:
parent
23a1c501ff
commit
17ac06a24a
|
|
@ -863,6 +863,7 @@ dbwPrintValue0(int value, /* value to print, in internal units */
|
|||
break;
|
||||
|
||||
case DBW_UNITS_USER:
|
||||
crec = (DBWclientRec *)w->w_clientData;
|
||||
if (is_square)
|
||||
{
|
||||
oscale = (float)((crec->dbw_gridRect.r_xtop -
|
||||
|
|
@ -880,7 +881,7 @@ dbwPrintValue0(int value, /* value to print, in internal units */
|
|||
oscale = (float)(crec->dbw_gridRect.r_ytop -
|
||||
crec->dbw_gridRect.r_ybot);
|
||||
}
|
||||
fvalue = (float)value * oscale * dscale;
|
||||
fvalue = (float)value * dscale / oscale;
|
||||
if (is_square)
|
||||
{
|
||||
fvalue *= dscale;
|
||||
|
|
|
|||
Loading…
Reference in New Issue