Commit c53d160c authored by Claes Sjofors's avatar Claes Sjofors

Ge command 'move selected' bugfix (refs #42)

parent c06174f7
...@@ -1911,7 +1911,7 @@ static int graph_move_func( void *client_data, ...@@ -1911,7 +1911,7 @@ static int graph_move_func( void *client_data,
} }
y0 = double(value); y0 = double(value);
} }
else if ( ODD( dcli_get_qualifier( "/ABSy", str, sizeof(str)))) { else if ( ODD( dcli_get_qualifier( "/ABSY", str, sizeof(str)))) {
sts = sscanf( str, "%f", &value); sts = sscanf( str, "%f", &value);
if ( sts != 1) { if ( sts != 1) {
graph->message('E', "Syntax error"); graph->message('E', "Syntax error");
...@@ -1926,8 +1926,9 @@ static int graph_move_func( void *client_data, ...@@ -1926,8 +1926,9 @@ static int graph_move_func( void *client_data,
} }
grow_StoreTransform( graph->current_cmd_object); // grow_StoreTransform( graph->current_cmd_object);
grow_SetObjectPosition( graph->current_cmd_object, x0, y0); // grow_SetObjectPosition( graph->current_cmd_object, x0, y0);
grow_MoveObject( graph->current_cmd_object, x0, y0);
grow_SetModified( graph->grow->ctx, 1); grow_SetModified( graph->grow->ctx, 1);
return GE__SUCCESS; return GE__SUCCESS;
......
...@@ -3943,6 +3943,12 @@ void grow_SetObjectPosition( grow_tObject object, double x, double y) ...@@ -3943,6 +3943,12 @@ void grow_SetObjectPosition( grow_tObject object, double x, double y)
((GlowArrayElem *)object)->set_position( x, y); ((GlowArrayElem *)object)->set_position( x, y);
} }
void grow_MoveObject( grow_tObject object, double x, double y)
{
grow_tCtx ctx = (grow_tCtx)((GlowArrayElem *)object)->get_ctx();
((GlowArrayElem *)object)->move( x * ctx->mw.zoom_factor_x, y * ctx->mw.zoom_factor_y, 0);
}
void grow_SetObjectScale( grow_tObject object, double scale_x, double scale_y, void grow_SetObjectScale( grow_tObject object, double scale_x, double scale_y,
double x0, double y0, glow_eScaleType type) double x0, double y0, glow_eScaleType type)
{ {
......
...@@ -1537,6 +1537,14 @@ extern "C" { ...@@ -1537,6 +1537,14 @@ extern "C" {
*/ */
void grow_SetObjectPosition( grow_tObject object, double x, double y); void grow_SetObjectPosition( grow_tObject object, double x, double y);
//! Move the object.
/*!
\param object Object to move.
\param x Movement in x direction.
\param y Movement in y directino.
*/
void grow_MoveObject( grow_tObject object, double x, double y);
//! Scale an object. The scale is made form the last stored transform. //! Scale an object. The scale is made form the last stored transform.
/*! /*!
\param object Object to scale. \param object Object to scale.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment