Resize page to content - offset issue

This is NOT a support forum. You are welcome to discuss software issues here, but all issues should be reported on Launchpad if you want them fixed.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Resize page to content - offset issue

Postby brynn » Tue Oct 26, 2010 7:41 pm

Hi Friends,
I'm not sure I would call this a bug, but just that this feature doesn't work as I expected, or as it appears it should work.
  • Ok, Document Properties > Resize page to content.
  • There you set your page dimensions, and if you don't want the page to fit exactly the selection or page, you can set the amount of offset for each top, bottom, left and right. So I set everything as I want it, and click :Resize page to drawing or selection" bar/button.
What I expected (and I should admit that I have not read the manual) was that all six text fields' values would be set in that one single click of the Resize... bar/button. However, it only sets the dimensions and the Left offset. The only way (that I've found) to set all 4 offets is to set the remaining Top, Bottom and Right offsets, one at a time, clicking the bar/button after each value is set.

I'm on Windows 7, 64-bit, Inkscape 0.48 stable release.

Has anyone else noticed this, or can reproduce it? Maybe it should be reported?
Thanks for your help :D

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Resize page to content - offset issue

Postby ~suv » Tue Oct 26, 2010 10:40 pm

brynn wrote:What I expected (and I should admit that I have not read the manual) was that all six text fields' values would be set in that one single click of the Resize... bar/button. However, it only sets the dimensions and the Left offset.
A click on the 'Resize page to drawing or selection' button does not set the left (or any other) offset margin -- unless you entered a value there. Note that the margins are stored in the SVG file, i.e. if you later resize the same document, they are read from the file and used again as margins. So maybe what you saw was actually the value for the left margin you had used in an earlier action to resize the page.
brynn wrote:The only way (that I've found) to set all 4 offets is to set the remaining Top, Bottom and Right offsets, one at a time, clicking the bar/button after each value is set.
Has anyone else noticed this, or can reproduce it? Maybe it should be reported?
You could file a feature request for an additional button to set one value for all four margins or to reset all of them. I can't see a bug in the current behavior, but yes, you have to manually enter each margin value.

Note that it is not necessary to click the button 'Resize...' each time after entering a value into one of the fields. Set all values (use <Tab> to cycle through the entry fields) and click the button once, when all options are set as you need them.


For a quick one-click resize with equal margins you could also resort to the old way before the margins option was added (it's a new feature in 0.48): draw a rectangle on-canvas, centered with the drawing contents, outset it (each step adds 1px on each side, but you can set the steps used for In-/Outset in the preferences) and resize the page to the selected rectangle. Then just delete the rectangle if no longer needed.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Resize page to content - offset issue

Postby ~suv » Tue Oct 26, 2010 11:07 pm

brynn wrote:(and I should admit that I have not read the manual)
It is not documented in the manual (because it is new in 0.48) but mentioned in the release notes (listed in 'Other features').

The feature was implemented based on Bug #499942 in Inkscape: “"Fit page to selection" needs margin options”and briefly discussed in inkscape-devel: 'Subject: Fit page to selection margin options'.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Resize page to content - offset issue

Postby brynn » Tue Nov 23, 2010 9:06 am

Oh gosh, I don't know how I missed this so long ago :oops:
A click on the 'Resize page to drawing or selection' button does not set the left (or any other) offset margin -- unless you entered a value there. Note that the margins are stored in the SVG file, i.e. if you later resize the same document, they are read from the file and used again as margins. So maybe what you saw was actually the value for the left margin you had used in an earlier action to resize the page.

Huh? No, this is on a new doc that had not previously been resized. After I finish the drawing, I Select All, open Doc Prop and click Resize. Then I set a 10.0 px margin for all 4 sides, and click Resize again. But only the Top margin is set. I have to set the Left, Right and Bottom margins one at a time -- type the Left value, click Resize, type the Right value, click Resize, etc.

Note that it is not necessary to click the button 'Resize...' each time after entering a value into one of the fields.

Yes it is. That's the problem I'm reporting. And since I lost track of this topic, I've now had the same experience on....geez, 8 or 10 more docs. It never works as you say it should.

Set all values (use <Tab> to cycle through the entry fields) and click the button once, when all options are set as you need them.

When I do this, only the Top margin is set. I have to set the remaining margins one at a time, as I've described.

I'm not looking for a way to type all 4 margin values at once. I'm looking to click Resize once, and have whatever values I typed, all be set in that one click.

Thanks again, and sorry for taking so long to respond.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Resize page to content - offset issue

Postby ~suv » Tue Nov 23, 2010 9:41 am

Revisiting and testing again with 0.48 and 0.48+devel r9916 r9914, on Mac OS X 10.5.8 (yes, my previous testing was sloppy, sorry for that):
brynn wrote:When I do this, only the Top margin is set. I have to set the remaining margins one at a time, as I've described.

I'm not looking for a way to type all 4 margin values at once. I'm looking to click Resize once, and have whatever values I typed, all be set in that one click.

It works as expected if values for each of the margin fields are entered for the first time in a new document (all four margins are set at once after clicking 'Resize page to drawing or selection', but indeed fails for subsequent changes [*] (i.e. as you describe the 'Resize' button then has to be clicked for each changed value).

-> yes, this seems not to be the expected nor the intended behavior: a bug in the UI of 'Resize page to content…'


[*] technically, once the four margins have been written to the SVG document for later reuse, 'Fit page to…' only takes one changed margin value into account when clicked:

Code: Select all

  <sodipodi:namedview
     (…)
     fit-margin-top="40"
     fit-margin-left="15"
     fit-margin-right="15"
     fit-margin-bottom="50">
If those four 'fit-margin' attributes are deleted from the SVG file (using e.g. the XML Editor), the next 'Fit page to contents…' command again sets all four margins with one click.
Last edited by ~suv on Tue Nov 23, 2010 1:00 pm, edited 1 time in total.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Resize page to content - offset issue

Postby brynn » Tue Nov 23, 2010 12:15 pm

It works as expected if values for each of the margin fields are entered for the first time in a new document (all four margins are set at once after clicking 'Resize page to drawing or selection', but indeed fails for subsequent changes [*] (i.e. as you describe the 'Resize' button then has to be clicked for each changed value).

In my experience, it fails the first and every time. It has never worked properly for me.

Not unless clicking Resize first without setting values, counts as setting values to zero. Ok yes, I just tried setting margin values before clicking Resize for the first time, and it does indeed work properly.

Let me try to be very clear, in case I'm not using the proper vocabulary.

If I click Resize without first typing margin values, and then next try to set margin values, it must be done one at a time.
But if I type in margin values before clicking Resize, they ARE all set with that one click.

I'll submit a bug report. Thanks for your help ~suv :D

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Resize page to content - offset issue

Postby brynn » Tue Nov 23, 2010 12:43 pm

Bug# 680347

~suv, please feel free to improve vocabulary if the language of my report is misleading or unclear, or of course add comments if necessary :mrgreen:

Thanks again :D


Return to “Discuss Software Issues”