This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Rotate text in Gift Editor 90degrees

Hello.

I would like to add a button at the navigation (next to zoom) which when it is clicked it will rotate the current (selected) vObject 90degrees.

How can we do that with javascript, without needing to postback the page?
Hello Marios,

Here is the code snippet of function, which allows rotate selected VObjects in 90 degrees:
…
var phl = Sample.get_photoLabel();
var cv = phl.get_canvasViewer().get_canvas();
var cvo = cv.get_currentVObject();
var r = cvo.get_rectangle();
if (r.Angle == 0 ) 
  r.Angle = 90;
cvo.set_rectangle(r);
…
Thank you very much.

I inserted the code, but when i click the button, i have to click into the card after so the text to be rotated.
Is there any way to "refresh" the canvas?
Hello Marios,
I inserted the code, but when i click the button, i have to click into the card after so the text to be rotated. Is there any way to "refresh" the canvas?

As far as I understand, you need to select TextVObject to rotate it clicking the button. It should work so. We select object, which is become “current”, and rotate it. Unfortunately, there is no another way.