示例#1
0
        public AttachRulerToBrick(LayerRuler.RulerItem rulerItem, LayerBrick.Brick brick)
        {
            // compute the attach offset in local coordinate
            PointF attachOffset = RulerAttachementSet.Anchor.sComputeLocalOffsetFromLayerItem(brick, rulerItem.CurrentControlPoint);

            // create a new Anchor
            mAnchor = new RulerAttachementSet.Anchor(rulerItem, rulerItem.CurrentControlPointIndex, attachOffset);
            mBrick  = brick;
        }
 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;
     }
 }
示例#3
0
 public DetachRuler(LayerRuler.RulerItem rulerItem, LayerBrick.Brick brick)
 {
     mAnchor = brick.getRulerAttachmentAnchor(rulerItem);
     mBrick  = brick;
 }