Allow ignoring boundary box size for arrange function

Bug #1374822 reported by Wong Cho Ching
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
In Progress
Wishlist
Wong Cho Ching

Bug Description

Proposal: Allow ignoring boundary box size for arrange function
Possible application: sprite sheet.
See details in attachment.
Patch* available in comment.
*Edit: _Not_ tested under WITH_GTKMM_3_0. The UI may, or may not look good when compiled with WITH_GTKMM_3_0

Update:
Here is an example illustrate the use of this new function:
For simplicity, consider a 1D place for drawing. Says, there are 3 objects. Their widths are 35, 15, and 25. It looks like this:
[35][25][35]
Now, we use the rearrange function without using the new check box, with 40 padding, it would looks like this:
[35](40)[25](40)[35], the thing inside () are space.
With the check box checked, it would look like this:
[35](5)[25](15)[35]
It is because 40-35=5 and 40-25=15. With this option enabled, the size of the boundary box is now ignored.

Revision history for this message
Wong Cho Ching (chwong249664) wrote :
Revision history for this message
Wong Cho Ching (chwong249664) wrote :
Revision history for this message
Wong Cho Ching (chwong249664) wrote :
description: updated
description: updated
description: updated
Revision history for this message
su_v (suv-lp) wrote :

Patch tested with r13573 on OS X 10.7.5

It seems a useful feature to add. The new option AFAICT works as described - one issue I noticed is that the x,y position of the rearranged selection changes unexpectedly:

Steps to demonstrate the offset:
1) select objects to be arranged
2) set options as needed, check "[x] Ignore Box Size"
3) click on 'Arrange' repeatedly

Expected result:
No further changes after objects have been arranged the first time

Actual result:
The relative arrangement stays unchanged, but the selection as a whole is offset each time the button is pressed again.

The direction and the amount of the offset seems to vary depending on the values set for the x and y spacings.

I also noticed a small typo in the patch:
'on_ingore_box_checkbutton_changed' instead of 'on_ignore_box_checkbutton_changed'

Changed in inkscape:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Wong Cho Ching (chwong249664) wrote :

Thanks for the feedback!

This updated patch fixes the following:
* The global shift issue
* the typo
* layout of UI of WITH_GTKMM_3_0, note: still not tested

Further reviews of this patch are welcomed. :)

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

While testing the second version of the patch (offset issue is fixed, GTK3 compiles and is functional), I was wondering whether it would make sense to make this option affect more than just the x, y spacing:

Currently, the alignment options are based on the largest bounding box of the selected objects, independent of whether the spacing is absolute, or based on the same bounding box size.

What about making the alignment relative to the cells of the grid too, if 'Ignore Box SIze' is checked? This would allow to align objects to the center right (or e.g. the bottom left) of a 'grid cell'.

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

On 2014-10-03 11:53 (+0100), ~suv wrote:> What about making the alignment relative to the cells of the grid too,
> if 'Ignore Box SIze' is checked? This would allow to align objects to
> the center right (or e.g. the bottom left) of a 'grid cell'.

Nevermind, I figured out how to achieve such an effect with the current patch as is (align objects first (within selection) based on the targeted alignment of 'Rows and Columns').

jazzynico (jazzynico)
Changed in inkscape:
assignee: nobody → Wong Cho Ching (chwong249664)
milestone: none → 0.92
status: Confirmed → In Progress
su_v (suv-lp)
tags: added: selection transformations
jazzynico (jazzynico)
Changed in inkscape:
milestone: 0.92 → 0.93
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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