This project has moved and is read-only. For the latest updates, please go here.

MoveAfterRotation

Move triangle and line to appropriate position after rotation for avoiding rotation at corner issue on browser with Silverlight environment.
' x, y - triangle position
' width, height - size of triangle
' angle - rotate angle
tri = Shapes.AddTriangle(0, 0, 0, height, width, height)
Shapes.Move(tri, x, y)
cx = x + width / 2
cy = y + height / 2
Shapes.Rotate(tri, angle)
If silverlight Then
  a = Math.GetRadians(angle)
  _cx = cx * Math.Cos(a) - cy * Math.Sin(a)
  _cy = cx * Math.Sin(a) + cy * Math.Cos(a)
  _ox = ox - (_cx - cx)
  _oy = oy - (_cy - cy)
  Shapes.Move(tri, _ox, _oy)
EndIf

See Also

Other Resources


Last edited Jan 15, 2016 at 6:29 PM by Nonki, version 4