[scribus] Scripter pica measure bug?

Craig Bradney cbradney at scribus.info
Sun Aug 3 08:48:13 UTC 2014


On 3/08/2014 10:44 am, Craig Bradney wrote:
> On 3/08/2014 10:07 am, Juraj Fedel wrote:
>> On Sun, Nov 10, 2013 at 08:53:42AM -0500, Gregory Pittman wrote:
>>> On 11/08/2013 12:58 PM, José Antonio Rocha wrote:
>>>> In Scripter console:
>>>>
>>>> print pt
>>>> result:
>>>> 1.0
>>>>
>>>> print p
>>>> result:
>>>> 1.0
>>>>
>>>
>>> After a little fishing, I can find this in units.cpp, starting at line 38:
>>>
>>> 	//                  PT,        MM,       IN,   P,             CM,
>>>          C,   °,   %
>>> 	double ratio[] = { 1.0, 25.4/72.0, 1.0/72.0, 1.0,      2.54/72.0,
>>> 25.4/72.0/4.512, 1.0, 1.0 };
>>> // 	double ratio[] = { 1.0, 25.4/72.0, 1.0/72.0, 1.0/12.0, 2.54/72.0,
>>> 25.4/72.0/4.512, 1.0, 1.0 };
>>> 	return ratio[index];
>>>
>>> What you see here is that the line with the correct ratio has been
>>> commented out for some reason.
>>>
>>> I changed the code to fix the ratio, and it compiles and /seems/ to work
>>> Ok (nothing seems broken so far). This fixes the result you get in the
>>> console.
>>>
>>> I'm reluctant to commit this, not being one of the devs, so we'll wait
>>> for their feedback.
>>>
>>> Greg
>>
>> I was looking at units.cpp file recently and noticed this was not fixed
>> yet. There was surely a reason to comment out the correct data, I am
>> wandering what it was? My guess is that nobody is using pica as units
>> (including me) and this bug (if it is a bug) remaind unnoticed.
>>
>> As an addition: to me it seems that last two members does not belog to
>> this array as they represent different measurement than the rest. All
>> are measurig lenght, "°" represent angle (is it in radian or degrees?)
>> and "%" is pure number without dimension.
>>
> 
> 
> There's no bug here. Picas are just points, displayed differently, so we changed to using a 1:1
> ratio in unit conversion.
> 

Maybe Scripter needs a fix though.

Craig




More information about the scribus mailing list