Indicator Draw text alignment got messed up with last update

Created at 20 May 2013, 07:39
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
lec0456's avatar

lec0456

Joined 14.11.2012

Indicator Draw text alignment got messed up with last update
20 May 2013, 07:39


The last update messed up the alignments for DrawText.  I was able to center my text using a negetive alignment but now it will not work.

 string strLondonLabel=string.Format("{0,-60}","London");


this used to align the text left but it no longer works properly.  PLease check the indicator below, you can see how it is supposed to look but after the last update it no longer centers properly

/algos/indicators/show/261


@lec0456
Replies

cAlgo_Fanatic
20 May 2013, 12:01

We are investigating this.  This bug is related to our change that improves text rendering performance.


@cAlgo_Fanatic

cAlgo_Development
20 May 2013, 17:18

We've found the bug. The problem is that leading spaces are ignored when we align text now. It will be fixed in the next release. Temporary solution you can apply without dramatic changes in your indicator is following:

Add point or another small symbol to the end to get string like "London                              ." instead of "London                              ", this is not so nice but it works:

 

        string strLondonLabel = string.Format("{0,-60}.", "London");
        string strNYLabel = string.Format("{0,-20}.", "NY");
        string strSydneyLabel = string.Format(".{0,25}", "Sydney");
        string strTokyoLabel = string.Format(".{0,60}", "Tokyo");
        
        string format = paramFormat24HR == 1 ? "H:mm" : "h:mmtt";
      
        string strLondonTime = string.Format("\n{0,-60}.", LondonTime.ToString(format));
        string strNYTime = string.Format("\n{0,-25}.", NYTime.ToString(format));
        string strSydneyTime = string.Format("\n.{0,25}", SydneyTime.ToString(format));
        string strTokyoTime = string.Format("\n.{0,60}", TokyoTime.ToString(format)); 




@cAlgo_Development

lec0456
20 May 2013, 21:30

ok great!


@lec0456