Jump to content
You must now use your email address to sign in [click for more info] ×

Transform Value Fields Repeatable Crash


Recommended Posts

You can reliably make the program crash by keying into the H or W fields a math expression which includes parenthesis. Ex: "3*(1+2)"

 

Result: It gives the "An unhandled exception has occurred" alert and then crashes the program.

 

Expected result: An appropriate alert should appear, of course, when a user enters values which are unsupported or invalid. But it should restore the previous value, not crash the program.

 

Just for discussion:

I know the example above doesn't require parenthesis. I just wanted to test it because as I recall, FreeHand's value fields could evaluate expressions, beyond simple multiplication-division and addition-subtraction operators.

 

It's long been a pet peeve with me that here we are in the 21st century and the value fields of some vector drawing programs still can't do simple arithmetic, let alone support the same functions as any common spreadsheet program. So I do appreciate Affinity's preference settings for decimal rounding and at least simple operators in fields. But how great it would be, for example, to be able to enter sin() and cos() expressions for scale factors and measures.

 

(Okay. Rant over, I'll sleep better.)

 

;-)

 

JET

Link to comment
Share on other sites

  • Staff

There was a "small" bug in the parsing of parenthesis.  Now fixed.

 

Incidentally, we can already do complex functions, and we already offer functions including:

min(a,b )

max(a,b )

mid(a,b )

sq(x)

sqrt(x)

abs(x)

lerp(a,b,t)

clamp(a,min,max)

sin(angle)

cost(angle)

tan(angle)

 

Note: Angle has to be in an angle unit, such as deg or rad.  So, you'd type "sin(45deg)".  I'm looking at the option of promoting un-typed values to the type required by functions (so a number would be promoted to an angle where required).  We are a little strict about types because we allow for values to be expressed in incompatible types, such as percentages, angles and unit distances.

So, you cannot do "5mm + 40deg", for example.

SerifLabs team - Affinity Developer
  • Software engineer  -  Photographer  -  Guitarist  -  Philosopher
  • iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395
  • MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300
  • iPad Pro 10.5", 256GB
Link to comment
Share on other sites

Incidentally, we can already do complex functions, and we already offer functions including:

 

Holy cow! That's great! I'll be playing around with this this evening. This would be a strong differentiator from other programs, worth touting in the marketing.

 

Basic trig functions in a vector drawing program. What a concept!

 

;-)

 

Thanks.

 

JET

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

Terms of Use | 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.