JET_Affinity Posted July 31, 2016 Share Posted July 31, 2016 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 More sharing options...
Mark Ingram Posted August 1, 2016 Share Posted August 1, 2016 Thanks JET, I've logged this and we'll get a fix available soon. Link to comment Share on other sites More sharing options...
Staff Ben Posted August 1, 2016 Staff Share Posted August 1, 2016 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. Andy Somerfield and anon1 2 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 More sharing options...
anon1 Posted August 1, 2016 Share Posted August 1, 2016 https://forum.affinity.serif.com/index.php?/topic/18638-units/?p=86227 Here are even more infos Link to comment Share on other sites More sharing options...
JET_Affinity Posted August 1, 2016 Author Share Posted August 1, 2016 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 More sharing options...
Recommended Posts