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 300799 - Shapes need midpoints
Shapes need midpoints
Status: RESOLVED OBSOLETE
Product: dia
Classification: Other
Component: shapes
CVS head
Other All
: High enhancement
: ---
Assigned To: Alan Horkan
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2005-04-15 21:02 UTC by Lars Clausen
Modified: 2013-09-13 19:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
need python 2.3 - modifies the XML of shapes inserting the midpoint (8.42 KB, text/plain)
2005-04-19 00:50 UTC, Paolo Bernardi
Details

Description Lars Clausen 2005-04-15 21:02:29 UTC
After the introduction of midpoints in Dia, a lot of shapes need updating. 
Specifically, each shape needs a new connectionpoint defined in the center of
the object with the midpoint attribute on.  See for example the Square shape of
the Assorted sheet.  This bug should be a clearinghouse for what shapes gets
fixed by whom.
Comment 1 Lars Clausen 2005-04-15 21:03:57 UTC
I meant "main" attribute, as can be seen from the Square shape.
Comment 2 Paolo Bernardi 2005-04-19 00:47:52 UTC
hello,

just for a 1st approach a wrote this Python code.
It need to hard-code the path to the shapes,
and I only tested it against Assorted.

It only reveals (and not fixes) a problem with 2 shapes from Assorted
(comments behind the root-element).

Tomorrow I'll test the other libs.
Hi

Paolo Bernardi
Comment 3 Paolo Bernardi 2005-04-19 00:50:04 UTC
Created attachment 45422 [details]
need python 2.3 - modifies the XML of shapes inserting the midpoint
Comment 4 Alan Horkan 2005-04-19 12:01:17 UTC
> It only reveals (and not fixes) a problem with 2 shapes from Assorted
> (comments behind the root-element).

I'm 99% sure that is perfectly legal and valid SVG (I had to check the
specifciations when making Gradients for Openclipart.org and putting comments at
the end of the document outside the root node allowed me to workarounds some
flaws in a particular SVG parser).  

You will need to provide a really good reason to change it.  
Which two shapes was it?  
Comment 5 Lars Clausen 2005-04-21 18:25:09 UTC
Drat, I wish I'd seen this before doing my own script.  I made a little Perl
script to do your method B, which I think works for a greater number of strange
shapes.  We'll need to check the shapes anyway.

The shapes below had zero or one connection points, and so I didn't add any main
point to them.  Probably the middle of the object would do, but they're few
enough to do manually.

Only one connection in shapes/ChemEng/fan.shape
Only one connection in shapes/Circuit/ground.shape
Only one connection in shapes/Circuit/microphone_de.shape
Only one connection in shapes/Civil/bvrest.shape
Only one connection in shapes/Civil/hrest.shape
Only one connection in shapes/Civil/vrest.shape
Only one connection in shapes/Cybernetics/b-sens.shape
Only one connection in shapes/Cybernetics/l-sens.shape
Only one connection in shapes/Cybernetics/r-sens.shape
Only one connection in shapes/Cybernetics/t-sens.shape
Only one connection in shapes/network/flash.shape
Only one connection in shapes/network/modem.shape
Only one connection in shapes/network/rj45plug.shape
Only one connection in shapes/network/sceadplug.shape
Only one connection in shapes/Pneumatic/cnx.shape
No connections in shapes/Pneumatic/commusc.shape
No connections in shapes/Pneumatic/compb.shape
No connections in shapes/Pneumatic/compush.shape
No connections in shapes/Pneumatic/comspr.shape
Only one connection in shapes/Pneumatic/drain.shape
Only one connection in shapes/Pneumatic/presspn.shape
Only one connection in shapes/RDP/transition.shape
Only one connection in shapes/SDL/comment.shape
Only one connection in shapes/SDL/return.shape
Only one connection in shapes/SDL/stop.shape
Only one connection in shapes/sybase/rsm.shape
Comment 6 Lars Clausen 2005-04-21 18:28:48 UTC
We now need to check that all objects are properly midpointed.  Below is a list
of directories with shapes, then we can start working off of them.  Please add a
comment if you start on a chunk.  The autogenerated shapes are in tonights CVS.

shapes/Assorted
shapes/ChemEng
shapes/Circuit
shapes/Cisco
shapes/Civil
shapes/Contact
shapes/Cybernetics
shapes/Electric
shapes/flowchart
shapes/jigsaw
shapes/Logic
shapes/Map/Isometric
shapes/Misc
shapes/MSE
shapes/network
shapes/Pneumatic
shapes/RDP
shapes/SDL
shapes/sybase
Comment 7 Lars Clausen 2005-04-21 19:22:18 UTC
Doing Assorted, ChemEng
Comment 8 Lars Clausen 2005-04-25 21:16:16 UTC
Done with Assorted, ChemEng, Circuit, Cisco - Computer, Cisco - Hub.

I'm finding the easiest way is to use layers to group the shapes -- I group into
those that need manual handling, those that should just use the middle of the
bounding box, those that have no interior, and those that have no or one
connection points (and thus no midpoint yet).  The names can then be extracted
from dia files with only some layers saved with -e.  Two of those groups can be
fixed with Paolo's code.
Comment 9 Torben H. Nielsen 2006-02-03 12:27:24 UTC
This one is related to: #329603
Comment 10 Jim Michaels 2008-08-15 05:31:21 UTC
So far I see no need for a logic gate to have a connection point in the center.

I have noticed, to my chagrin, that when drawing a rectangle shape and adding text, there is this point in the center that snaps any text to it if it gets anywhere inside the rectangle (and the text starts in the center and flows toward the edge, looking terrible).  really annoying misfeature of dia.  Snap is off. something is misfunctioning.  thinking of making this a separate bug unless this is really the place.
Comment 11 Hans Breuer 2008-08-15 09:44:07 UTC
Elaborating about misfeatures with snap to object being off is definitely another bug report. At least if it is not just a misunderstanding about the available properties for text alignment.
Comment 12 Hans Breuer 2013-09-13 19:55:43 UTC
I consider the quest for main points closed (697 shapes have it).
Plus they are checked for bad misplacements with unit test. See:
https://git.gnome.org/browse/dia/commit/?id=97add178fedc641344cb813edb682c45c8c4817f