1
C / sfCircleShape_move
« on: March 11, 2023, 03:47:37 pm »
Draw a circle, trying to move it.
The sfCircleShape_move function must move the object by the given offset. But the movement goes along the coordinates specified in the parameters of this function, or a generally incomprehensible result
Result:
![](https://i.postimg.cc/MZyfyc0R/sfMove1.jpg)
Works:
![](https://i.postimg.cc/x8XPjMFc/sfMove2.jpg)
It feels like I'm the only one with the problems.
The sfCircleShape_move function must move the object by the given offset. But the movement goes along the coordinates specified in the parameters of this function, or a generally incomprehensible result
sfCircleShape *circle = sfCircleShape_create();
sfCircleShape_setRadius(circle, 20 - 3);
sfCircleShape_setOutlineThickness(circle, 3);
sfCircleShape_setOutlineColor(circle, sfBlack);
sfCircleShape_setFillColor(circle, sfWhite);
sfVector2f CirclePosOld = {800 / 2, 600 / 2};
sfCircleShape_setPosition(circle, CirclePosOld) ;
sfVector2f CirclePosNew = { 50, 50 } ;
sfCircleShape_move(circle, CirclePosNew );
float fPosOld_x = CirclePosOld.x ;
float fPosNew_x = sfCircleShape_getPosition(circle).x ;
float fPosOld_y = CirclePosOld.y ;
float fPosNew_y = sfCircleShape_getPosition(circle).y ;
sfCircleShape_setRadius(circle, 20 - 3);
sfCircleShape_setOutlineThickness(circle, 3);
sfCircleShape_setOutlineColor(circle, sfBlack);
sfCircleShape_setFillColor(circle, sfWhite);
sfVector2f CirclePosOld = {800 / 2, 600 / 2};
sfCircleShape_setPosition(circle, CirclePosOld) ;
sfVector2f CirclePosNew = { 50, 50 } ;
sfCircleShape_move(circle, CirclePosNew );
float fPosOld_x = CirclePosOld.x ;
float fPosNew_x = sfCircleShape_getPosition(circle).x ;
float fPosOld_y = CirclePosOld.y ;
float fPosNew_y = sfCircleShape_getPosition(circle).y ;
Result:
![](https://i.postimg.cc/MZyfyc0R/sfMove1.jpg)
Works:
sfVector2f CirclePosOld = {800 / 2, 600 / 2};
sfCircleShape_setPosition(circle, CirclePosOld) ;
sfVector2f CirclePosNew = {CirclePosOld.x + 50, CirclePosOld.y + 50 } ;
sfCircleShape_setPosition(circle, CirclePosNew) ;
sfCircleShape_setPosition(circle, CirclePosOld) ;
sfVector2f CirclePosNew = {CirclePosOld.x + 50, CirclePosOld.y + 50 } ;
sfCircleShape_setPosition(circle, CirclePosNew) ;
![](https://i.postimg.cc/x8XPjMFc/sfMove2.jpg)
It feels like I'm the only one with the problems.