Bug 175510 - Make SnapToGeometry more configurable
Summary: Make SnapToGeometry more configurable
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows 2000
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-26 07:07 EST by David Sciamma CLA
Modified: 2007-03-16 09:30 EDT (History)
3 users (show)

See Also:


Attachments
An example of extensible SnapToGeometry (15.60 KB, text/plain)
2007-02-26 07:20 EST, David Sciamma CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Sciamma CLA 2007-02-26 07:07:21 EST
Currently, the behavior of SnapToGeometry is not really configurable :
* What directions (vertical, horizontal) are allowed
* what sides of the other figures are used to define the corrections
* ...

Moreover the class cannot be easily extended because of the "Entry" class with a protected constructor unusable outside SnapToGeometry.
Comment 1 David Sciamma CLA 2007-02-26 07:20:37 EST
Created attachment 59776 [details]
An example of extensible SnapToGeometry

The attached class defines a extensible SnapToGeometry where directions can be customized (horizontal, vertical) and snapped sides can be filtered
Comment 2 Randy Hudson CLA 2007-02-26 11:54:09 EST
(Just to propose other use cases which I don't think the patch mentions or handles)

In my own use of this class, I extended the class to provide the following customizations:

1) Change the location of the snapped edges. I wanted them offset from the actual figures (so that right and left snaps had a gap between them).
2) Change the "priority" of edges. I wanted LEFT to be the most important, then CENTER, RIGHT.

And I plan on making further customizations to align objects using their baseline rather than their vertical middle. Baseline alignment would be highest priority for vertical snapping in my use case.