Jump to content

Inconsistencies in field input expressions

Recommended Posts

Sometimes, when using some mathematical functions in input fields, the Unit Of Measure needs to be given for the expression to be calculated.
For example, when I enter “+=cos(30)*10” (without the quotes) into the X field of the Transform Panel there is no effect, but entering “+=cos(30)*10 mm” (with the UOM) moves the selected layer as expected.
Also, entering “x+cos(30)*10” (no UOM) into the X field yields no movement while entering “x+cos(30)*10 mm” (with UOM) also yields no movement, so providing the UOM is no guarantee of an expected result.
However, entering “x+fraction(2.5)” (no UOM) does produce a movement.
This behaviour is inconsistent.

This happens on both Windows and OS X (no reports so far for iPad so I don’t know what happens there).
This has only been checked in Designer (as far as I know) but all apps need testing, with expressions of differing complexity.

Also, the Help for this needs to be expanded with better explanations of what each function does and example usage. For example, the Help lists “cos(t)” as a function but doesn’t say whether “t” should be in degrees or radians. Most functions don’t even have a description, which is a bit limiting.
Basically the Help for this should contain much more information but the most important thing (in this case) is to get the functions working consistently.

See the discussion (with a small test result table) here: https://forum.affinity.serif.com/index.php?/topic/104444-transforming-an-object-relative-to-its-position/&

Share this post

Link to post
Share on other sites

Hey @GarryP,

Trigonometry functions require units to work. Otherwise, that "value" can be anything. 

As for the second example, "x +" requires a distance value, so the "cos(30)*10" needs to be converted to mm before the "+" can be applied. So, x+(cos(30)*10 mm) works.

Share this post

Link to post
Share on other sites

Thanks for picking this up Gabe.

I would have expected, as do some other people in the linked thread, that the 10 in x+cos(30)*10 would default to the document units in the same way that, by way of two examples, x+10 and x+fraction(2.5) do. As that’s not the case, I think this needs to be documented in some way so users know when they need to use units or don’t need to use them. For instance, is it only the trig functions or others too? If it’s explicit in the documentation then people can know what’s what.

There’s also the situation where x+cos(30)*10mm does not do anything but x+(cos(30)*10mm) does, note the extra parentheses used. There’s nothing in the documentation to explain where parentheses are needed or not and in which situations.

I think both of these things need to be documented – along with more general info’ as requested above – as there’s no feedback to tell the user that they have entered an equation incorrectly; the value just ‘springs back’ to the last value and the user could just assume that it’s worked.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.