Recent

Author Topic: [SOLVED] Alignment values for TEdit and TMemo mixed up on Mac aarch64  (Read 360 times)

d4eva

  • New Member
  • *
  • Posts: 13
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).
« Last Edit: June 26, 2022, 01:26:24 pm by d4eva »

d4eva

  • New Member
  • *
  • Posts: 13
Re: Alignment values for TEdit and TMemo mixed up on Mac aarch64
« Reply #1 on: June 25, 2022, 09:43:03 pm »
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 ?
« Last Edit: June 25, 2022, 09:45:34 pm by d4eva »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2762
    • havefunsoft.com

d4eva

  • New Member
  • *
  • Posts: 13
Re: Alignment values for TEdit and TMemo mixed up on Mac aarch64
« Reply #3 on: June 26, 2022, 01:26:11 pm »
Thanks. I applied the patch and now it's all good on M1.

 

TinyPortal © 2005-2018