20 Aug
2013
20 Aug
'13
3:59 p.m.
On Tue, 2013-08-20 at 17:36 +0200, Krzysztof KosiĆski wrote:
Another problem is that the name chosen for this function is extremely long. I have no idea who invented the "Util" namespace, this should all be in the Inkscape namespace preferably as a global function (gratuitous use of namespace is a plague in our code), or what does "Quantity" mean. Ideally the code should look like this:
p0[X] = Inkscape::convert_unit(p0[X], "px", "in");
I think this is more expressive that p0[X] * IN_PER_PX.
Put this at the top of the code:
using namespace Inkscape::Util;
Then it /should/ be a case of calling:
p0[X] = Quantity::convert(p0[X], "px", "in");
Which makes a lot of sense. The only thing more convoluted would be:
p0[X] = convert(Quantity(p0[X], "px"), "in");
Martin Owens,