Help lines are off after calling fit page to selection

Bug #234834 reported by wrtlprnft
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Unassigned

Bug Description

It looks like help lines aren't transformed when pressing Fit page to selection from the Document Properties dialog.

To reproduce:
- Open a new document
- Drag a new help line onto the canvas
- Draw a new rectangle somewhere in relation to the new help line
- Shift+Ctrl-D Alt-F

I'm also getting a little drawing error if I'm still using the rectange mode, see screenshot. It goes away after switching to another tool, though.

I'm using Inkscape 0.46 on GNU/Linux (Gentoo, cairo 1.4.14).

Tags: guides
Revision history for this message
wrtlprnft (wrtlprnft) wrote :
Revision history for this message
wrtlprnft (wrtlprnft) wrote :

I made a little patch that translates the guides whenever SPDocument::fitToRect is called. Either it misteriously fixes the drawing bug, too, or it was already fixed in the current bzr version (more likely).

This is the first time I tried to modifiy inkscape's source code, but I tried my best to use the methods the rest of the code uses.

Revision history for this message
sas (sas-sas) wrote :

I've tried this, and it fixes the problem with guides. The other bug is still present though (on Windows XP) - strange that it should be gone for you.

TortoiseSVN didn't like the bzr patch, so I had to fiddle about with it to get it to apply. I'm attaching a svn patch in case anyone else wants to test it before it's committed.

Revision history for this message
wrtlprnft (wrtlprnft) wrote :

I dunno, the self-fixing of the display bug may just be due to the fact that I just ran inkscape from its source dir when testing my patch, leading to a messed up version with most icons and all (configurable) keyboard shortcuts missing.

Anyways, I made another change: Why not scroll the viewport so the drawing doesn't appear to me. It happened to me a few times that the drawing was completely moved out of the viewport when using the fit page command, it might be confusing to users.
Maybe that also fixes the bug :-)

I hope I didn't reinvent the wheel, but I couldn't find a function that let me scroll in SVG world coordinates (at least not without zooming at the same time).

Revision history for this message
wrtlprnft (wrtlprnft) wrote :

SVN patch (apparently you can't attach two files to the same comment)

Revision history for this message
wrtlprnft (wrtlprnft) wrote :

Sorry, forgot to remove a debug line.

Revision history for this message
wrtlprnft (wrtlprnft) wrote :

Here's a somewhat cleaned up version that scrolls all desktops (if there's more than one) and doesn't use a somewhat private (?) function from outside SPNamedView.

In case anyone's confused, there's a weird typo in my second comment, it should be “doesn't appear to move”, not “doesn't appear to me”.

Revision history for this message
sas (sas-sas) wrote :

Nobody has raised any objections to your patch, so I've committed it (SVN revision 18749).

There are similar problems that occur when adjusting the page height (or clicking on one of the standard page sizes). These ought to be fixed too, so I'm marking this bug as In Progress.

Changed in inkscape:
status: New → In Progress
jazzynico (jazzynico)
tags: added: guides
Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.47
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.