Re: Default size for shapes



On Tue, Nov 6, 2012 at 10:05 PM, Hans Breuer <hans breuer org> wrote:
At 06.11.2012 15:46, Harold wrote:
If I create a shape with either a size of 1000 or 1, the object is
always the same size when adding them to the layout.

Please take a look into the specification of custom shapes:
http://git.gnome.org/browse/dia/tree/doc/custom-shapes#n109

IIRC this documentation is also included the user manual.

Thanks! The default-width/height enabled me to create realy small
shapes like this:

<?xml version="1.0"?>
<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns";
xmlns:svg="http://www.w3.org/2000/svg";>
  <default-width>0.3</default-width>
  <default-height>0.3</default-height>
  <name>Capacitor</name>
  <icon>capacitor.png</icon>
  <aspectratio type="fixed"/>
  <connections>
    <point x="0" y="0.15"/>
    <point x="0.3" y="0.15"/>
  </connections>
  <svg:svg>
    <svg:line x1="0" y1="0.15" x2="0.08" y2="0.15"/>
    <svg:rect style="fill: inverse" x="0.08" y="0" width="0.05" height="0.3"/>
    <svg:rect style="fill: inverse" x="0.17" y="0" width="0.05" height="0.3"/>
    <svg:line x1="0.22" y1="0.15" x2="0.3" y2="0.15"/>
  </svg:svg>
</shape>


The only problem I now have is adding a textbox. If I use <textbox
x1="-0.1" y1="-0.2" x2="0" y2="0" align="left"/> the tiny shape grows
to humongous proportions again, probably due to the large default font
size of 22.68 pt.

What tiny textbox can I add to the tiny shape to stop it from gowing?


How can I create a smaller shape? Bonus points for telling me how I
can create a non-scalable shape ;)

Having some extra state to enable non-resizable shapes would require some
source code modification in the custom shape module, e.g.:
http://git.gnome.org/browse/dia/tree/objects/custom/custom_object.c#n759

It is not part of specification or implementation yet.

Well, let's skip this part for now ...


Cheers!


Harold



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]