After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 451006 - Custom Shape Sizing
Custom Shape Sizing
Status: RESOLVED OBSOLETE
Product: dia
Classification: Other
Component: shapes
0.96
Other All
: Normal enhancement
: ---
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2007-06-25 18:35 UTC by Alistair Grant
Modified: 2014-03-02 12:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alistair Grant 2007-06-25 18:35:36 UTC
Please describe the problem:
When creating custom shapes and loading them into sheets and then using the created shapes, the scaling is incorrect. For shapes with no textbox, the shapes are resized to 2cm height and for shapes with a textbox the shape seems to be doubled in size. This makes using the program very unsatisfing  and slows productivty.

Steps to reproduce:
1. Create a rectangle with a textbox
2. Export as custom shape
3. Add to a sheet
4. Use new shape in diagram
5. Observe behaviour


Actual results:
THe shape scale is incorrect, with a textbox is it too big, 2x size.

Expected results:
The shape should be the size speced by the xml shape file.

Does this happen every time?
Yes.

Other information:
Windows Platform. 

Example File:

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns" xmlns:svg="http://www.w3.org/2000/svg">
  <name>\ - Test</name>
  <icon>Test.png</icon>
  <connections>
    <point x="0.0" y="0.0"/>
    <point x="14.0" y="3.0"/>
    <point x="0.0" y="3.0"/>
    <point x="0.0" y="3.0"/>
    <point x="14.0" y="0.0"/>
    <point x="14.0" y="3.0"/>
    <point x="7.0" y="3.0"/>
    <point x="7.0" y="0.0"/>
  </connections>
  <aspectratio type="fixed"/>
  <textbox x1="3.0" y1="1.0" x2="11.0" y2="2.0"/>
  <svg:svg>
    <svg:rect style="fill: #ffffff" x="0.0" y="0.0" width="14.0" height="3.0"/>
    <svg:rect style="fill: none; fill-opacity:0; stroke-width: 0.1; stroke: #000000" x="0.0" y="0.0" width="14.0" height="3.0"/>
  </svg:svg>
</shape>
Comment 1 Lars Clausen 2007-08-09 18:13:51 UTC
The spec file doesn't really specify a size as such, merely a bunch of things that have their various sizes, including connections, textbox and the SVG.  Getting all that to give a correct size is not trivial, especially when SVG is involved.  At the same time, shape makers have not been considering the actual size of the object important, so some shapes may have overly large or small sizes.  I also believe there's another bug reported about this problem.

The fact that a textbox causes a different size is a problem which should be fixed.  Trying with your shape, I see the difference based on the presence of the textbox.  I just don't see a similar thing in any other shape, so I have little idea what could have caused this.  It's not the aspect ratio or the particular coords you've used.

BTW, I suggest using 'foreground' and 'background' instead of #ffffff and #000000, unless there's a strong reason to force the objects to be black and white.
Comment 2 Steffen Macke 2007-08-09 21:12:32 UTC
Fixed by Lars. Fix will be included in version 0.97. Thanks for the bug report!
Comment 3 Lars Clausen 2007-08-10 07:24:34 UTC
No, I just fixed the caching issue that was confusing us in examining the real problem, namely why the textbox appears to make the shape larger.  Doesn't have anything to do with the connectionpoints or aspect ratio, AFAICT.
Comment 4 Hans Breuer 2007-09-16 18:43:33 UTC
AFAIK resize_with_text is an option of Dia's textbox, general custom shape sizing is a difficult feature because it would apply to all those existing shape files which somewhat rely on fixed sizing. OTOH additional attributes could be used to have a reliable default size?
Comment 5 Hans Breuer 2009-01-18 17:26:31 UTC
For a change to be made for 0.97 I would need either a patch or at least understand what the suggested change would be. From my understanding of 
	http://svn.gnome.org/viewvc/dia/trunk/doc/custom-shapes?view=log
the given shape works exactly as specified.
Comment 6 Hans Breuer 2014-03-02 12:17:22 UTC
AFAICT obsoleted by the addition of default-width and default-height attributes.