Forum > Cocoa

[SOLVED] Alignment values for TEdit and TMemo mixed up on Mac aarch64

(1/1)

d4eva:
Please see the attached picture - taCenter works as taRightJustify and vice versa.
And I only encounter this on Mac M1 when Lazarus is recompiled to native aarch64 (it works fine in Intel mode).
Lazarus 2.2.2 on macOS Monterey 12.4 (both M1 and Intel).

d4eva:
Update:
NSTextAlignmentRight is defined as 1 in cocoaprivate.pas

Here's the Apple's doc - https://developer.apple.com/documentation/uikit/nstextalignment/nstextalignmentright

Declaration
NSTextAlignmentRight = 2

Note
In Mac apps, including apps built with Mac Catalyst, the value of this enumeration case is 1.


Currently I'm dealing with this issue by using {$IF Defined(DARWIN) and Defined(CPUAARCH64)} I just taRightJustify instead of taCenter. Maybe this should be applied to cocoaprivate.pas ?

skalogryz:
here's the patch
https://github.com/fpc/Lazarus/compare/main...skalogryz:ArmTextConstants

here's the explanation of what is happening:
https://www.patreon.com/posts/68248169

d4eva:
Thanks. I applied the patch and now it's all good on M1.

Navigation

[0] Message Index

Go to full version