Commit bed7fb61 authored by Claes Sjofors's avatar Claes Sjofors

Ge bugfix in move dynamic with scale in combination with DigSwap

parent 2679958e
......@@ -6027,6 +6027,13 @@ int GeMove::connect( grow_tObject object, glow_sTraceData *trace_data)
width_orig = ur_x - x_orig;
height_orig = ur_y - y_orig;
}
else {
grow_RevertTransform( object);
grow_GetObjectBorder( object);
grow_MeasureNode( object, &x_orig, &y_orig, &ur_x, &ur_y);
width_orig = ur_x - x_orig;
height_orig = ur_y - y_orig;
}
return 1;
}
......@@ -6041,6 +6048,7 @@ int GeMove::disconnect( grow_tObject object)
if ( scale_y_p && scale_y_db == graph_eDatabase_Gdh)
gdh_UnrefObjectInfo( scale_y_subid);
move_x_p = move_y_p = scale_x_p = scale_y_p = 0;
return 1;
}
......
......@@ -189,6 +189,7 @@ class GlowArrayElem {
virtual void set_transform( GlowTransform *t) {};
virtual void set_transform_from_stored( GlowTransform *t) {};
virtual void store_transform() {};
virtual void revert_transform() {};
virtual bool transform_is_stored() { return false;};
virtual void get_node_borders() {};
virtual void get_ctx( void **ctx) {};
......
......@@ -4831,6 +4831,11 @@ void grow_StoreTransform( grow_tObject object)
((GlowArrayElem *)object)->store_transform();
}
void grow_RevertTransform( grow_tObject object)
{
((GlowArrayElem *)object)->revert_transform();
}
int grow_TransformIsStored( grow_tObject object)
{
return (int) ((GlowArrayElem *)object)->transform_is_stored();
......
......@@ -2251,6 +2251,12 @@ extern "C" {
*/
void grow_StoreTransform( grow_tObject object);
//! Revert transform to stored state.
/*!
\param object Object.
*/
void grow_RevertTransform( grow_tObject object);
//! Check if there is a stored transform
/*!
\return Returns 1 if the transform is previously stored with a call to grow_StoreTransform.
......
......@@ -689,6 +689,7 @@ class GrowNode : public GlowNode {
/*! The stored transform can be used as starting point for future scaling or rotations.
*/
void store_transform() { trf.store(); };
void revert_transform() { trf.revert(); get_node_borders();};
//! Check if there is a stored transform
/*!
......
......@@ -66,6 +66,8 @@ class GlowTransform {
double rot() { return rotation;};
void store() { s_a11=a11;s_a12=a12;s_a13=a13;s_a21=a21;s_a22=a22;s_a23=a23;
s_rotation=rotation; stored=true;};
void revert() { a11=s_a11;a12=s_a12;a13=s_a13;a21=s_a21;a22=s_a22;a23=s_a23;
rotation=s_rotation;};
void scale_from_stored( double sx, double sy, double x0, double y0);
void rotate_from_stored( double angle, double x0, double y0);
void move_from_stored( double x0, double y0);
......
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