[Mac] Label text stretching

102 views
Skip to first unread message

Travis Stutsman

unread,
Jun 5, 2014, 6:42:36 PM6/5/14
to xwt-...@googlegroups.com
(I am working against the mono/xwt GitHub repo on commit 6b86f3f [June 5, 2014 at 9:21:39 AM PDT])

I found a very strange Mac-specific issue where the text of a Label gets stretched.  (Example below.)


The following conditions will replicate this behavior:

  • Label within a VBox
  • BackgroundColor set on the VBox
  • Include Mono runtime (no linking) in project options
  • Xwt.Mac (Xwt.XamMac for including Mono runtime)

Initially the text looks normal, but as soon as you start resizing the Label via its container, it stretches.

If the BackgroundColor is not set on the VBox or the Mono runtime is not included the stretching will not occur.

If you set the Label.Text after stretching has occurred it will go back to normal.

I also noticed that setting VBox.BackgroundColor causes NSView.WantsLayer = true on line 389 in ViewBackend.cs (Xwt.Mac).  According to Apple documentation, this "Specifies whether the receiver and its subviews use a Core Animation layer as a backing store."  This might be a key item for this issue.  If you comment out lines 388-390 the stretching does not occur.



Does anyone have any ideas about what could be causing this behavior?  Thanks in advance.
-- Travis

Vsevolod Kukol

unread,
Jan 16, 2015, 4:54:35 AM1/16/15
to xwt-...@googlegroups.com
Hi! I know its an old issue, but could you try this fix https://github.com/mono/xwt/pull/447?
Reply all
Reply to author
Forward
0 new messages