public MoveRulerControlPoint(LayerRuler layer, LayerRuler.RulerItem rulerItem, PointF originalPosition, PointF newPosition)
 {
     mRulerLayer        = layer;
     mRulerItem         = rulerItem;
     mControlPointIndex = rulerItem.CurrentControlPointIndex;
     mOriginalPosition  = originalPosition;
     mNewPosition       = newPosition;
     // compute the new attach offset if the control point is attached
     if (rulerItem.IsCurrentControlPointAttached)
     {
         LayerBrick.Brick attachedBrick = rulerItem.BrickAttachedToCurrentControlPoint;
         mAnchor = attachedBrick.getRulerAttachmentAnchor(rulerItem);
         mOriginalLocalAttachOffset = mAnchor.LocalAttachOffsetFromCenter;
         mNewLocalAttachOffset      = RulerAttachementSet.Anchor.sComputeLocalOffsetFromLayerItem(attachedBrick, newPosition);
         mAttachedBrickOrientation  = attachedBrick.Orientation;
     }
 }
Esempio n. 2
0
 public DetachRuler(LayerRuler.RulerItem rulerItem, LayerBrick.Brick brick)
 {
     mAnchor = brick.getRulerAttachmentAnchor(rulerItem);
     mBrick  = brick;
 }