Re: Non-uniform scaling preview.




On Sat, 2007-11-10 at 02:00 +0100, Marcel Toele wrote:
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.

Great!  I'm very happy to see so many contributions coming in, the next
release is going to be a big change.

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).

How do you know? :)  Not that I see a problem in adding to the
namespaces, but updating the schemas would be a good idea.

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">

While I see that adding some Dia-specific attributes to the SVG tag is
probably the nicest way to go about this, I think the naming could be
improved.  Instead of v_anchor and h_anchor, why not just anchor with
possible values northwest, north, northeast etc?  What does the "fixed"
in the anchor values mean, and what are the alternatives?  Having that
part separate (and perhaps optional, if there's a good default) would
remove the need to parse the attribute value.  The default_scale name
suggests there's a way to set a non-default scale, is that the case?  I
would like to be rid of the half-bit subshape attribute, what purpose
does it serve that couldn't be inferred from the presence of anchor and
scale attributes?


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.html

Nice, I can definitely see uses for this.

-Lars




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