Why does macOS Catalina display a decimal point in the Xcode Constraints value?

Link to image: https://gyazo.com/8ecec9816e9a262e54c7215feed06a76

This image is a screen shot of Add New Constraints on macOS Catalina + Xcode10.3. (Same for Xcode11.1)


In macOS Mojave, it is displayed as an integer such as `414`, `0`.

In macOS Catalina, it is displayed with a decimal point such as `414.0`, `.0`.


Why does macOS Catalina display a decimal point in the Xcode Constraints value?


Is it possible to select the display in some macOS settings?

Replies

I checked on XCode11.1 / Mojave, creating size constraints.

I get 2 values:

339 (no .0)

and 16.5


Did you try to set the constraint to an Int value, save it and reopen ?

When used in Mojave, set the constraint to 0 and reopen the Add New Constraint panel, you will see `0` without a decimal point.

However, if you open the same project in Catalina, you will see `.0` with a decimal point.


This occurs regardless of the Xcode version, whether Xcode10.3 or 11.1.

Could be that Catalina now displays by default Float with one decimal, to show it is a Float.


We can't say it is a bug, it is not (IMHO) a serious issue in XCode either, but would be interesting to hnow precisely what has changed (it may affect apps as well).


You could ask for documentation clarification via bug report.

Thank you for your reply.


This is not a serious issue for me too.

However, I am interested in why the display of Constraints values is affected by the macOS version.


I would like to wait for information from other members who can clearly explain the internal mechanism why this issue occurs.

Do all other constraints show the same behavior (like align constraints or leading constraints) ?

YES.

All constraints on Add New Alignment Constraints panel (like Leading Edges, Horizontally in Container) show the `.0` with a decimal point.

And also in the size inspector when you look at an object constraint ?

NO.


In the size inspector area, all integer values not show a decimal point.

(includes x, y, width, height, constraints constant, constraints multiplier)


Only the Add New Constraints panel and the Add New Alignment Constraints panel show a decimal point.

Its doing the same thing to me too.


And while I agree it is not a bug, it is very annoying. When setting constraints, I usually click on the field and type the number even if there is 0 in front, it doesn't change what I am typing. Typing 100 shows '0100' which is converted to the right value.


With this new behavior, I end up with .0100 which is not at all what I wanted.


Yes, I can clik in the constraint field to select it and than double click to select the entire content and overwrite it. Like I said, not a bug, but just annoying.


Hopefully, they will come back to the previous behaviour, if not I'll just need to acquire a new habit :-)

… Or file an enhancement request.