"Fit page to selection" needs margin options

Bug #499942 reported by Alex Leone
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Alex Leone

Bug Description

In document properties, "Fit page to selection" needs margin options. Also in export bitmap when using the "Drawing" or "Selection" options.

Proposed fix: Using the same units as selected, add entry boxes for top, bottom, left, and right margins.

Tags: ui

Related branches

Revision history for this message
su_v (suv-lp) wrote :

related RFEs:
Bug #277967 “Wishlist item: Putting a margin around an entire image”
Bug #433184 “Margins and bleed”

Changed in inkscape:
importance: Undecided → Wishlist
Revision history for this message
Alex Leone (acleone) wrote :

Here's a patch against bzr rev 8863.

This adds margin options below the "Fit page to selection" button in the Document Properties dialog.

Revision history for this message
Alex Leone (acleone) wrote :

And a development log

Revision history for this message
jazzynico (jazzynico) wrote :

Patch tested successfully on Ubuntu 9.10.

As for the UI, I fell a bit lost when the specific options expand. I'd rather see a flat UI, maybe better integrated in the custom size section. A button allowing the use of a single value for all margins would also be welcome.

Follow up to the dev list for comments and review.

Thanks for this very useful patch!

Changed in inkscape:
assignee: nobody → Alex Leone (acleone)
status: New → In Progress
Revision history for this message
Alex Leone (acleone) wrote :

Here's another version of the UI, now with a new frame for "Fit page to selection or drawing".

jazzynico (jazzynico)
tags: added: ui
Revision history for this message
Alex Leone (acleone) wrote :

Another UI version, now with the "Fit page to selection" button moved into an expandable section in the "Custom size" frame.

Revision history for this message
Alex Leone (acleone) wrote :

Another UI version:
 - "Format" header changed to "Page Size"
 - Removed "Page Size:" label before list of page sizes (list with A4, letter, etc)
 - Changed "Page orientation:" to "Orientation:"
 - The expander is now labelled "Resize page to content..."
 - The "Resize page to selection/drawing with margins:" button is the first thing in the expander

Revision history for this message
Alex Leone (acleone) wrote :

Changed UI:
 - Resize button is now "Resize page to drawing or selection".
 - "Top:" margin option is "Top margin:".

Revision history for this message
ScislaC (scislac) wrote :

Tested and Committed in BZR rev 8952. Thanks Alex!

Changed in inkscape:
status: In Progress → Fix Committed
milestone: none → 0.48
Revision history for this message
su_v (suv-lp) wrote :

@Alex - there's a small issue that's bugging me with your new margin options for page resize:

The values for the margins are stored in the document and reused for further 'Fit page to content…' commands. However when reopening a previously resized document those (to be used) values are not loaded into the entry fields of the dialog - displaying the default '0.00' for all margins despite that fact that stored values from the document will be applied to its next resize operation.

reproduced with Inkscape 0.47+devel r9456 on OS X 10.5.8

Any chance you could take a look at this?

Revision history for this message
Alex Leone (acleone) wrote :

Ok, the margin options will now load from the SVG attributes. See commit r9462.

Revision history for this message
su_v (suv-lp) wrote :

fix confirmed with Inkscape 0.47+devel r9462 on OS X 10.5.8

Thank you for your expeditious response! Can I ask you a related question? The values stored for the four margins appear to be unit-less and are not recalculated when the user changes the units for the document custom size in the same widget (which is not related to the document's 'Default units' setting at the top). Keeping the absolute value of the margins potentially leads to absurd resizing results e.g. when changing custom size units from 'px' to 'm' while leaving the margins unchanged at '20.00' (former px): a document margin of 20 meters is not exactly expected nor intended by the user IMHO. Is there a rationale behind this? AFAICS the other settings stored in 'namedview' are based on 'px' and converted if needed to the units set by the user.

Possibly related: bug #586955 “the unit for user defined document size is not refreshed if document is reopen”
<https://bugs.launchpad.net/inkscape/+bug/586955>

jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
Revision history for this message
su_v (suv-lp) wrote :

New follow-up report:
Bug #680347 “page margins can't be reset with single click of Resize”
<https://bugs.launchpad.net/inkscape/+bug/680347>

Revision history for this message
su_v (suv-lp) wrote :

As reported in the comments of bug #680347, page margins are broken in current trunk: only the value for the top margin is considered when resizing the page to content/drawing:

Works (with limitations as reported in bug #680347) with
Inkscape 0.48+devel r9944 custom, built Dec 9 2010 (OS X 10.5.8 i386)

Fails (only considers top margin) with
Inkscape 0.48+devel r9950 custom, built Dec 12 2010 (OS X 10.5.8 i386)

-> regression was introduced between r9944 and r9950
(possibly by the merge of the C++-ification branch in r9946?)

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.