LibreOffice Module svx (master)  1
Classes | Namespaces | Enumerations
svdsnpv.hxx File Reference
#include <svx/svdpntv.hxx>
#include <svx/svdhlpln.hxx>
#include <svx/svxdllapi.h>
#include <tools/degree.hxx>
#include <o3tl/typed_flags_set.hxx>
Include dependency graph for svdsnpv.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


struct  o3tl::typed_flags< SdrSnap >
class  SdrSnapView




enum  SdrSnap {
  SdrSnap::NOTSNAPPED = 0x00,
  SdrSnap::XSNAPPED = 0x01,
  SdrSnap::YSNAPPED = 0x02
 Definition: More...
enum  SdrCrookMode {

Enumeration Type Documentation

enum SdrCrookMode

Definition at line 84 of file svdsnpv.hxx.

enum SdrSnap


  • snap something means e.g. the mouse pointer or some marked objects in drag can be snapped
  • snap on something means you can e.g. snap on the grid or on auxiliary lines

Basically, we only catch visible elements (borders, helper lines, connectors), with the exception of the grid. Likewise, we can only catch visible elements (i.e. connectors). We only catch on the grid, if nothing else is close by (magnetic behaviour).

The cursor which is used during creation of objects, while dragging polygon points etc. (i.e. the mouse cursor) is always caught on all enabled catch alternatives (max 6).

This is different, when moving selected objects. Instead of one mouse cursor, there are four alternatives, which can be caught at the selected objects:

  1. the logically enclosing frame of every single object
  2. the logically enclosing frame of all selected objects
  3. highlighted points of all selected objects (polygon points, ...)
  4. the connectors of the selected objects

As the first and second case exclude each other (the second is a refinement of the first one) three alternatives remain, which are independent from each other. For 6 possible values for the caught ones, we would end up with max. 18 different possible combinations!

Therefore, we introduce the following simplifications:

  1. Connectors only catch on connectors

Only max. 2*5+1 = 11 combinations remain for MoveDrag: 1-3. enclosing frame on grid/border/helper lines

  1. enclosing frame on highlighted object points
  2. enclosing frame on enclosing frame 6-8. highlighted points on grid/border/helper lines
  3. highlighted points on highlighted object points 8-10. highlighted points on enclosing frame
  4. connectors on connectors

We test for all of these possible 11 combinations in the MouseMove event in the DragMove and those with the least need of correction are carried out.

In the Resize() etc. methods we only catch the logically enclosing frame of the highlighted objects.Return value for SnapPos() method


Definition at line 72 of file svdsnpv.hxx.