Non-uniform scaling preview.
- From: "Marcel Toele" <dpy dia gmail com>
- To: "discussions about usage and development of dia" <dia-list gnome org>
- Subject: Non-uniform scaling preview.
- Date: Sat, 10 Nov 2007 02:00:46 +0100
Hi guys,
there are still a few little details to be resolved, but I've managed to put the non-uniform
scaling into dia custom shapes without too many code changes.
Basically, you write a dia .shape file as you normally would, but I've added a few
attributes to the "dia" namespace (which is virtual, because nobody uses the schemas anyway).
What you could end up with, is a shape file that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns" xmlns:dia="
http://www.daa.com.au/~james/dia-shape-ns" xmlns:svg="http://www.w3.org/2000/svg">
<name>Test - Subshape2</name>
<icon>Subshape2.png</icon> <aspectratio type="free"/>
<svg:svg>
<svg:rect
style="fill:#47caf3;fill-opacity:1;stroke:black;stroke-width:0.1;stroke-miterlimit:4;stroke-opacity:1"
id="rect1874" width="12"
height="9"
x="0.078606814" y="0.062494233
" />
<svg:g
dia:subshape="true"
dia:v_anchor="fixed.top"
dia:h_anchor="fixed.right"
dia:default_scale="1.0" id="g1894">
<svg:path style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:
0.1;stroke-miterlimit:4;stroke-opacity:1" d="M 10.648626,2.3920465 L 10.420596
,3.5678268 L 10.075256,2.4210065 L 8.8994662,2.1929665 L 10.046296,1.8476265 L 10.274336,0.67183646 L 10.619666,1.8186665 L 11.795456,2.0467065 L 10.648626,2.3920465 z "
id="path4534" />
<svg:path
style="fill:#50f3d8;fill-opacity:1;stroke:black;stroke-width:0.04982572;stroke-miterlimit:4;stroke-opacity:1"
d="M 10.487136,2.2659065 L 10.255806,3.4586368 L 9.9054962,2.2952865 L 8.7127662,2.0639665 L 9.8761162,1.7136465 L 10.107446,0.52091646 L 10.457756,1.6842765 L 11.650486,1.9155965 L 10.487136,2.2659065 z "
id="path2762" />
</svg:g>
<svg:g
dia:subshape="true"
dia:v_anchor="
fixed.bottom"
dia:h_anchor="fixed.left"
dia:default_scale="1.0" id="g1894">
<svg:path
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-miterlimit:4;stroke-opacity:1"
d="M 2.7037033,7.8425233 C 2.0368455,9.2464345 3.3027196,7.1446755 1.8384648,7.6658509 C 0.37421,8.1870264 2.6833421,9.0163256 1.2794309,8.3494678
C -0.1244803,7.6826099 1.9772787,8.948484 1.4561033,7.4842292 C 0.9349279,6.0199744 0.1056287,8.3291065 0.7724865,6.9251954 C 1.4393443,5.5212842 0.1734702,7.6230432 1.637725,7.1018678 C 3.1019798,6.5806924 0.7928477,5.7513932
2.1967589,6.418251 C 3.6006701,7.0851088 1.498911,5.8192347 2.0200865,7.2834895 C 2.5412619,8.7477443 3.3705611,6.4386122 2.7037033,7.8425233 z "
id="path1939" />
</svg:g> </svg:svg>
</shape> Now obviously, this is mostly just an ordinary .shape file, however two groups (indicated in blue, (for those of you supporting html)), have a special meaning, because of the presence of a few special attributes from the above mentioned "dia" namespace. Their meaning is hopefully self-explanatory.
As I've said earlier, there are still a few issues left, but a preview movie (flash) of the current state of the art can be watched:
http://krnl.nl/dia_custom_shapes_with_non_uniform_scaling.htmlgreetings,
Marcel
--------------------------------------------------
Marcel Toele
Kern Automatiseringsdiensten BV
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]