Hi guys, With this post I present my non-uniform scaling patch (i.e. the non-scaling subshapes).
For more information about the way it works or its design decisions, please look at my previous posts: http://mail.gnome.org/archives/dia-list/2007-November/msg00023.html http://mail.gnome.org/archives/dia-list/2007-November/msg00031.html ...or you can directly look at the preview movie I made for that post: http://krnl.nl/dia_custom_shapes_with_non_uniform_scaling.html The patch that is presented here, is, as its name suggests, prepared against bleeding edge svn revision 3861, for easy integration into the project. Because of (understandable) complaints about my last submitted patch (custom lines, whose update is still pending), I have made sure that this time all the code is using the correct coding style and all indents are of proper depth and using spaces, not tabs. I've added the functionality by reusing as much code as was available and usable for the purpose of non-uniform scaling, to minimize future maintenance. A small portion of the drawing code (custom_draw) had to be further modularized to facilitate better reuse. This has resulted in two additional functions: 1. custom_draw_displaylist 2. custom_draw_element Apparent indent changes in these functions are the result of this modularization (e.g. loop-modularization results in less indentation, things like that), please do not mistakenly take these for malicious/accidental code re-indenting. The rest of the patch contains only small portions of code added to various places. Statistics: Number of updated lines: 160 Number of additional lines: 303 Things that are done/have been tested: - correct drawing/rendering of subshapes - duplicate/copy/paste of shapes containing subshapes - interactive rescaling of the subshape (aka the non-uniform scaling) (press and hold SHIFT while resizing horizontally) - saving/loading - object property changes: Flip x and Flip y - vertical anchors: fixed.top/fixed.bottom - horizontal anchors: fixed.left/fixed.right Things that have to be done, still: - proportional anchors. The code is fully prepared for it using two place holders (see patch), the algorithm is given in comment, but the actual code has not yet been written. - undo support with old subshape scale restoring using ObjectChange objects. (This requires pretty invasive changes for the objects/custom plugin, because it has been modelled with flip_x/flip_y in mind and not additional property changes, such as subscaling). - anything I haven't thought of/looked at yet, please tell me if you find something. I hope the patch works for you as well, if it doesn't please advise or supply further instructions. greetings, Marcel Toele Kern Automatiseringsdiensten BV
subshape_for_dia_svn_rev3861.patch.gz
Description: GNU Zip compressed data
subshape_for_dia_demo_shapes_and_sheets.tgz
Description: GNU Zip compressed data
_______________________________________________ Dia-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/dia-list FAQ at http://live.gnome.org/Dia/Faq Main page at http://live.gnome.org/Dia
