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 321820 - add ability to rotate objects
add ability to rotate objects
Status: RESOLVED OBSOLETE
Product: dia
Classification: Other
Component: general
CVS head
Other Linux
: Normal enhancement
: ---
Assigned To: Dia maintainers
Dia maintainers
: 465746 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-11-18 19:07 UTC by Eric Work
Modified: 2019-03-20 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Eric Work 2005-11-18 19:07:04 UTC
Distribution/Version: Gentoo Linux (amd64)

One missing feature that causes friends of mine to boot into Windows just for
Visio is the ability to rotate objects.  Is this feature present in the menus
and I'm just missing it?
Comment 1 Lars Clausen 2005-11-18 20:46:15 UTC
No, I'm sorry.  Making everything rotatable would require deeper structural
changes that I don't have the time for yet.  I do plan to add rotated text
fairly soon, though.
Comment 2 Lars Clausen 2005-11-25 09:01:51 UTC
Using this bug to jot down some ideas:

Maybe extend Point to hold a 'global point', so that the 'normal' x,y positions
are object-local.  Would help to have *all* point access encapsulated.  Global
points would need to be updated when local points are (dirty bit?).  Problem
would be to determine which accesses should use the local points and which the
global ones.  Obviously things like hitting objects with mouse clicks should use
global points -- or translate the click position into the objects local space.  
Comment 3 Joachim Otahal 2006-05-06 22:10:31 UTC
I am missing the rotate function too, everything else I need is there, missing shapes are easy to add (in win32 manually with .95 version, sheet-editor fails).
Rotating by 0°/45°/90°/135°/180°/225°/270°/315° would be enough from my point of view, maybe with a dumb-user checkbox like this:
o o o
 \|/
o-+-x  <- default
 /|\
o o o

For the start I wouldn't mind ascii editing the .dia file so set it manually.

I like the program.
Comment 4 Roland Stigge 2007-05-05 17:07:08 UTC
Just for the record (to find it later), this is also a Debian bug at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=405832
Comment 5 Steffen Macke 2007-08-11 18:33:37 UTC
*** Bug 465746 has been marked as a duplicate of this bug. ***
Comment 6 Don Blaheta 2008-05-18 21:39:13 UTC
I was going to submit a feature request, but mine is related to this one (but easier): I would like the ability to perform vertical and horizontal mirror-flips on objects (especially complex ones like polygons, bezierlines, etc).  180° rotation would also be nice, but is less often what I actually want.  This would be much easier than a general rotation.  The reason I want it is that probably half the time when I'm creating some sort of bezier-type figure it has a symmetric or near-symmetric element elsewhere in the diagram, and what I'd like to do is simply copy, paste, and flip, rather than copy, paste, and then manually drag everything around (or just start from scratch).
Comment 7 Steffen Macke 2008-05-19 15:03:53 UTC
Perhaps Dia can already do what you are looking for:

* Draw the objects you want to flip
* Save them as a Dia shape
* Add the shape to the diagram
* In the shape properties, you'll find horizontal and vertical flip.

Is that sufficient for you? Did I explain the approach in sufficient detail?
Comment 8 Don Blaheta 2008-05-20 04:54:43 UTC
That's good to know about.

No you didn't describe it in sufficient detail.  "Save them as a Dia shape" should be "Export it as a Dia shape file"; "Add the shape to the diagram" wasn't even close to enough explanation, but I've filed this in more detail as usability request #533974.

But in the end, I don't think this will quite do what I need in most cases, because it's really taking the long way around the problem and will probably take almost as long as just doing it by hand.  Also, afaict there is no way to edit the shape later, making the previous work wasted if anything changes.

Thanks, though....
Comment 9 Steffen Macke 2010-05-30 17:16:53 UTC
There's a first version of a rotation plugin in the Git repository:

http://dia-installer.de/doc/rotation.html.en

Maybe this solves some of your problems.
Comment 10 Joachim Otahal 2010-05-30 18:08:57 UTC
OS: Win7-64 ger
Phyton 2.3.5 installed (newer isn't detected by installer?).
pygtk-2.8.6-1.win32-py2.3 installed
dia-setup-0.97.1-1.exe installed
dia_rotate.py copied to C:\Program Files (x86)\Dia
Starting dia, putting simple looks-like-a-pipe shape there.
Selecting "Objects - simple rotation".

PyDia Error (diamodule.c:365):
<class exceptions.AttributeError at 0x02A65990><exceptions.AttributeError instance at 0x02B62E18>Traceback (most recent call last):
  • File "C:\Program Files (x86)\Dia\dia_rotate.py", line 101 in rotate_cb
    dlg = CRotateDialog(dia.active_display().diagram, data)
  • File "C:\Program Files (x86)\Dia\dia_rotate.py", line 26 in __init__
    win = gtk.Window()

My bad?
Comment 11 Steffen Macke 2010-05-30 18:19:21 UTC
Looks like you're missing PyGtk:

http://dia-installer.de/howto/python_win32/ar01s02.html#setup_pygtk

My fault, it's marked as "optional" in the Python setup instructions.
Comment 12 Joachim Otahal 2010-05-30 18:44:58 UTC
pygtk IS installed (see installation list above.
Difference now: pycairo is installed too.
pycairo-1.0.2-1.win32-py2.3.exe
No strange messages now.

The box shape (most simple shape) gets a bit squished around, but not rotated.
Two box objects connected with two lines, the boxes get squished, but the connection lines get rotated correctly, although they are not connected to the boxes any more *g*, dia corrects the connection lines as soon as I move one of the two boxes, the rotation position is lost then.

I guess this is reflects the very first pre-alpha state of the rotation tool : ).
Comment 13 Steffen Macke 2010-05-31 20:04:34 UTC
Sorry for my sloppy instructions. I should update the howto in this respect.
You're right about the box shape: That's part of the TODO I've mentioned on the page: "Convert rectangles to polygons".
Please don't expect too much of this tool - Even if it advances, it will not provide general rotation support in Dia. With grouped objects, embedded images, things get really tricky. I'll still consider the use by shape creators as it's main purpose - they'll also look over the connection line glitch. Enough excuses :-) Please continue to report problems and request enhancements.
Comment 14 Joachim Otahal 2010-05-31 20:24:07 UTC
Rotating of the shape is enough from my point of view, grouped objects and images are far less important.
Comment 15 Jim Michaels 2012-08-22 12:31:16 UTC
2d rotation can be achieved with simple trigonometry.  this is also supported with CSS3 transform:rotate();

2d rotation of a point at radius r,angle theta is thus:
x = x0 + r*cos(theta); //cos(theta)=x/r
y = y0 + r*sin(theta); //sin(theta)=y/r

but this

given point (x1,y1) near origin (x0,y0) unknown angle alpha rotating and landing at unknown position (x2,y2) at known angle theta:
remove the origin from the equation to get localized angles, and add it back in later to translate image back to origin.
r=sqrt(((x1-x0)*(x1-x0))+((y1-y0)*(y1-y0))); //r is required. 
alpha = atan2(y1-y0, x1-x0); //this we can throw away.
x2 = x0 + r*cos(theta);
y2 = y0 + r*sin(theta);

I would like to see rotations too. hope this helps. if rotating a point was your problem, this should help.
Comment 16 GNOME Infrastructure Team 2019-03-20 11:22:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/dia/issues/154.