GNOME Bugzilla – Bug 321820
add ability to rotate objects
Last modified: 2019-03-20 11:22:27 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?
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.
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.
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.
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
*** Bug 465746 has been marked as a duplicate of this bug. ***
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).
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?
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....
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.
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):
+ Trace 222161
dlg = CRotateDialog(dia.active_display().diagram, data)
win = gtk.Window()
My bad?
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.
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 : ).
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.
Rotating of the shape is enough from my point of view, grouped objects and images are far less important.
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.
-- 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.