Code: Select all
//DIRection 1=right, 2=flip, 3=left
my_RotatePoint( who, struct{"x":=item.x,"y":=item.y} , 1);
function my_RotatePoint( byref pivo, byref ponto , dir)
var difx := pivo.x - ponto.x;
var dify := pivo.y - ponto.y;
case (dir)
1: // Right
ponto.x := pivo.x + dify;
ponto.y := pivo.y - difx;
2: // Flip
ponto.x := pivo.x + difx;
ponto.y := pivo.y + dify;
3: // Left
ponto.x := pivo.x - dify;
ponto.y := pivo.y + difx;
endcase
endfunction
you can adapt it to receive 1 object or a list.