On Sat, Nov 12, 2005 at 10:04:02AM -0800, John Cliff wrote:
I've just commited some code that makes inkscape retain the
centre of rotations location after you move it so that next time you come back to it the centre is where you put it.
I don't think this should extend even across different editing sessions: i.e. I don't think the rotation centre should be stored in the SVG file, so I suggest reverting the following lines from sp-item.cpp:
+ sp_object_read_attr(object, "inkscape:r_cx"); + sp_object_read_attr(object, "inkscape:r_cy");
+ sp_repr_set_attr(repr, "inkscape:r_cx", ( item->r_cx ? NULL : "true" )); + sp_repr_set_attr(repr, "inkscape:r_cy", ( item->r_cy ? NULL : "true" ));
while in seltrans.cpp, replace inkscape:r_cx/y accesses with item->r_cx/y accesses.
Also, decide what type r_cx/y should have. Currently sp-item.cpp:sp_item_init treats them as pointers (storing NULL there), while sp-item.h says that they're doubles. Those fields currently aren't used anywhere else. As for the inkscape:r_cx/y attributes, sp_item_write sets them to either "true" or unset, while other code assumes that the attributes specify a unitless coordinate.
Note that the NULL/double discrepancy causes a warning in g++. Please try to avoid committing code that introduces warnings. Also, as a rule of thumb, I'd suggest avoiding committing new fields (SPItem:r_cx/y) that essentially aren't used in the current code base.
If you look at your diffs (and it's a good idea to look at one's diffs before committing), then you'll notice a mixture of different indentation amounts even within a given block, mixing spaces with tabs, and assuming different tab stops in different places. Please try to use either the function or file's existing indentation method, or the standard described in our Coding Style guidelines http://inkscape.org/doc/coding_style.php.
pjrm.