Bug 335473 - FlowLayout inconsistently handles major and minor spacing
Summary: FlowLayout inconsistently handles major and minor spacing
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: 3.6.1   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-26 12:07 EST by Alexander Nyßen CLA
Modified: 2012-02-21 17:36 EST (History)
1 user (show)

See Also:


Attachments
Javadoc Update for getMajorSpacing and setMajorSpacing (12.08 KB, patch)
2012-02-20 15:51 EST, Arieh Bibliowicz CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Nyßen CLA 2011-01-26 12:07:57 EST
FlowLayout seems to mix up major and minor spacing. That is, while the javadoc states that the major spacing affects "the spacing in pixels to be used between children in the direction parallel to the layout's orientation", which is in my eyes also the intuitive meaning of the term "major spacing", the value set for the major spacing actually affects the spacing perpendicular to the layout orientation, and vice versa. You may easily reproduce this using the FlowLayoutExample snippet of the Draw2d examples.
Comment 1 Randy Hudson CLA 2011-01-26 13:16:20 EST
All you can do is fix the javadoc.  "minor" means the children inside the rows.  "major" refers to the major pieces, i.e. the rows themselves.  So minor spacing is parallel to the row (when horizontal), but minor alignment is the vertical alignment within that horizontal row.
Comment 2 Alexander Nyßen CLA 2011-01-26 16:32:10 EST
(In reply to comment #1)
> All you can do is fix the javadoc.  "minor" means the children inside the rows.
>  "major" refers to the major pieces, i.e. the rows themselves.  So minor
> spacing is parallel to the row (when horizontal), but minor alignment is the
> vertical alignment within that horizontal row.

I fear you are right. However, this is really ugly, as major and minor alignment seem to be used in the opposite sense (i.e. they are used consistent with the current javadoc of minor and major spacing).
Comment 3 Arieh Bibliowicz CLA 2012-02-20 15:51:51 EST
Created attachment 211287 [details]
Javadoc Update for getMajorSpacing and setMajorSpacing

Expanded the explanation of what is the major spacing in both javadocs.
Comment 4 Alexander Nyßen CLA 2012-02-21 17:36:45 EST
Arieh, could you upload a patch, please? That would make it easier to consume your contribution.