COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 08-26-2010, 09:48 AM   #1
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default ITextControl and multiple lines

This is just a heads up to anyone that was using my IPlug additions. I had fixed the ITextControl in OSX so it could display multiple lines like the one in Windows can. Unfortunately the only way of doing this was to change the origin of the text so it was referenced to the top corner like the windows one (the current code draws relative to the bottom corner), so it is almost impossible to get it to exactly match the positioning of the version from Cockos.

So, I've decided to abandon this change and just use multiple ITextControls where I need to draw multiple lines.

If anyone else is using this feature (unlikely I know!) and wants to keep the multiline stuff working the lines to change are in IGraphicsMac:: DrawIText near the end, this is what it needs to be to draw relative to the top:

Code:
  NSRect r = { pR->L, pR->T-yAdj-1, pR->W(), pR->H() };
...
  [str drawWithRect:r options:  NSStringDrawingUsesLineFragmentOrigin
                                attributes: mTxtAttrs];
You may need to fiddle with the number following yAdj to get it to be in the same position as the windows one.
cc_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:53 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.