Inspiring
August 20, 2024
Question
Subtracting UnitValue from Number gives incorrect sign
- August 20, 2024
- 10 replies
- 1265 views
versions tested:
Photoshop 24.7.1
Photoshop 25.5.1
platforms tested:
Windows 10
Mac OSX Sonoma
steps to reproduce:
Run the following code
var test = 10 - UnitValue( 1, 'px' )
alert( 'expect 9 px:\n'+ test )
expected result:
Variable test should return a positive 9 px value
actual result:
Variable test returns a negative 9 px value
