GNOME Bugzilla – Bug 108838
Feature Request: Guides (lines coming out of rulers, like gimp and inkscape)
Last modified: 2019-03-20 11:06:08 UTC
Richard Jones wrote: I know I'm being lazy and I _should_ just implement this ... but anyway: a simple feature suggestion for dia. I think I first saw this in Visio, but it's been many many years since using Windows so I might be mistaken. Anyway, in Visio there are two moveable lines - one vertical and one horizontal. They don't do anything, you just move them around. But they're really useful for two things: (1) Lining things up so they line up vertically or horizontally, and (2) Marking out the "edge" of the paper, so you can mentally say to yourself "don't draw anything beyond this edge". Cyrille Chepelov replied: So in effect, this would be just like a line object, except that its draw routine would somehow detect that the canvas it's been drawing on is an interactive canvas (in which case it draws) or it's not (in which case it does nothing). Hmmm. Sounds interesting (this dynamic_cast<InteractiveRenderer> doesn't sound difficult now we've got GObject renderers, thanks to Hans). Besides, this doesn't even need to have all the formatting properties of lines, just something to make obvious that it's a formatting aid, not something printed (maybe even a static label property to remind this to the user). Lars Clausen replied: That's an interesting idea. Maybe tear-off the diagram-side rulers. Not high on my list, though. If you want to do this, go ahead.
I am fairly sure i know what you mean but a screenshot of what you mean would be good. are you sure the Gimp does not do anything like this already? (code reuse, or at least learn by example or if you do it yourself maybe add it to more than just Dia ...)
Created attachment 15327 [details] Screenshot showing rulers
Added the screenshot showing dia with rulers. By default, of course, there would be no rulers. You would have to add these, possibly from a menu item, although IIRC in Visio/the-package-I-was-using the rulers were hidden at the sides and a special drag would pull then onto the canvas. You use the rulers to line things up vertically and horizontally.
Dia already has rulers aroud the window edges, what you are describing are called guides. Guides usually include a function that allows you to snap objects to them. You might be able to add this funtionality by borrowing code from the gimp. Changing summary See my also my request here (which includes visio screenshots) http://bugzilla.gnome.org/show_bug.cgi?id=111640 (I haven't yet decided which report to close as the duplicate)
Even though I didn't think much of your attempt to describe this feature you do did post the request first so I'll close my later bug report as a duplicate of this one. Comements from bug 111640 included below. http://bugzilla.gnome.org/show_bug.cgi?id=111640 Feature: Guides (like in the Gimp) To add a guide to a document you click on the ruler and drag, this will insert a line parallel to the ruler. This is particularly useful in the GIMP which does not have a Grid (yet). Part of the utility of this feature is "Snap to Guides". In the examples I have added quite a few guidelines. The visio screenshot also includes Guide points, which look like little targets, and get drawn if you click in the top right corner just between the rules and drag to the page. I am hoping that because the Gimp has this feature that code can be borrowed. (might be an easy-fix, but i wont add the keyword until i know better). Page with the two examples of the Guide feature http://matrix.netsoc.tcd.ie/~horkana/dev/gnome/gnome-office/dia/screenshots.html Direct link to the Visio screenshot http://matrix.netsoc.tcd.ie/~horkana/dev/gnome/gnome-office/dia/screenshots/MicrosoftVisio2000_rulers_guides_guidepoints.png Direct link to the Gimp screenshot http://matrix.netsoc.tcd.ie/~horkana/dev/gnome/gnome-office/dia/screenshots/gimp_rulers_and_guides_screenshot.png
*** Bug 111640 has been marked as a duplicate of this bug. ***
I've started implementing guides like in the Gimp (i.e. click on ruler and drag). So far you can add, remove, and move the guides. There is also basic snapping. I'm planning to fix few things before I submit the final patch, though. Video demo attached below.
Created attachment 368984 [details] Video demo of work-in-progress patch.
Created attachment 369361 [details] [review] Patch to add guides as per GIMP.
Created attachment 369364 [details] Manual for guides.
I've attached the patch. I've also attached the documentation in PDF format. I'm hoping to integrate this into the Dia manual (http://dia-installer.de/doc/en/index.html) - if the patch is accepted, of course. Please test this if you have time, as it is quite a lot of code and I may have missed a bug or two.
-- 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/79.