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

Notification

Icon
Error

Options
Go to last post Go to first unread
NormanL  
#1 Posted : Friday, October 26, 2012 1:47:52 AM(UTC)
NormanL

Rank: Advanced Member

Groups: Guest
Joined: 4/26/2012(UTC)
Posts: 36

Thanks: 6 times
Hi,

I've noticed that there seems to be an issue with rotating TextVObject and ImageVObjects. If you use the remote scripting method to rotate the currently selected vector object then it will work for TextVObjects but not for ImageVObjects. Similarly if you use the client side method it will work for ImageVObjects but not TextVObjects!

Can this be fixed and an update released? In the short term is it possible to detect the type of the currently selected vector object client side so that I can call the appropriate method?

Below is the type of code I'm using to do the rotating server side and client side:

Code:
' Remote scripting method works for text objects not for image objects
Dim action As String = "Rotate Clockwise"
Dim vo As TextVObject = _canvasViewer.Canvas.CurrentVObject
'Dim vo As ImageVObject = _canvasViewer.Canvas.CurrentVObject
Dim angle As Double = vo.Transform.Angle
If action = "Rotate Clockwise" Then
   vo.Transform.Angle = IIf(angle + 10 >= 360, (angle + 10) - 360, angle + 10)
ElseIf action = "Rotate Anticlockwise" Then
   vo.Transform.Angle = IIf(angle - 10 < 0, (angle - 10) + 360, angle - 10)
End If


Code:
' Client side scripting method works for image objects not for text objects
var action = 'Rotate Clockwise';
var canvasViewer = $find('_canvasViewer');
var vo = canvasViewer.get_canvas().get_currentVObject();
var angle = vo.get_transform().get_angle();
var update = false;
if (action == 'Rotate Clockwise') {
   vo.get_transform().set_angle(angle + 10 >= 360 ? (angle + 10) - 360 : angle + 10);
   update = true;
}
else if (action == 'Rotate Anticlockwise') {
   vo.get_transform().set_angle(angle - 10 < 0 ? (angle - 10) + 360 : angle - 10);
   update = true;
}
if (update == true) {
   vo.quickUpdate();
}


Thanks
Dmitry.Obukhov  
#2 Posted : Sunday, October 28, 2012 11:03:18 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Guest
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Norman,

Thanks for posting this report. I will report about about it to our developers.
Quote:
In the short term is it possible to detect the type of the currently selected vector object client side so that I can call the appropriate method?

Sure, you can detect which VObejct is currently selected on the client side. You should check vo = canvasViewer.get_canvas().get_currentVObject(). It will contain Aurigma.GraphicsMill.AjaxControls.VectorObjects.ImageVObject if ImageVObject is current or Aurigma.GraphicsMill.AjaxControls.VectorObjects.TextVObject if TextVObject is selected.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
NormanL  
#3 Posted : Monday, November 5, 2012 2:04:01 AM(UTC)
NormanL

Rank: Advanced Member

Groups: Guest
Joined: 4/26/2012(UTC)
Posts: 36

Thanks: 6 times
Hi Dmitry,

Sorry for the delay in replying.

Any update on the issue with the obejcts not refreshing? I should have said that it won't refresh unless you move the mouse over the canvas.

Also could you give an example of how to determine the type of object using javascript - I see that canvasViewer.get_canvas().get_currentVObject()._getDataType() returns TextVObjectData or ImageVObjectData - is this a suitable method to use?

Thanks

Edited by user Monday, November 5, 2012 2:32:32 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#4 Posted : Wednesday, November 7, 2012 2:19:10 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Guest
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

Quote:
Any update on the issue with the obejcts not refreshing?

Unfortunately, no. I will keep you informed.
Quote:
Also could you give an example of how to determine the type of object using javascript - I see that canvasViewer.get_canvas().get_currentVObject()._getDataType() returns TextVObjectData or ImageVObjectData - is this a suitable method to use?

You can check _currentVObject and then use client-side code or server-side one.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.