/// <summary> /// Moves the cross to the next plot item. If no plot item is found in this layer, it moves the cross to the next layer. /// </summary> /// <param name="increment"></param> private void MoveUpDown(double increment) { _positionOfCrossInRootLayerCoordinates = _positionOfCrossInRootLayerCoordinates.WithYPlus(increment); DisplayCrossCoordinates(); _grac.RenderOverlay(); // no refresh necessary, only invalidate to show the cross }
public MeasuredLabelItem(Graphics g, FontX font, StringFormat strfmt, string itemtext, double lineSpacing, StringAlignment horizontalAlignment, StringAlignment verticalAlignment, StringAlignment textBlockAligment) { _text = itemtext.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); _stringSize = new PointD2D[_text.Length]; _font = font; _horizontalAlignment = horizontalAlignment; _verticalAlignment = verticalAlignment; _textBlockAligment = textBlockAligment; _strfmt = strfmt; _lineSpacing = lineSpacing; _size = SizeF.Empty; var bounds = RectangleD2D.Empty; var position = new PointD2D(); for (int i = 0; i < _text.Length; ++i) { _stringSize[i] = g.MeasureString(_text[i], GdiFontManager.ToGdi(_font), new PointF(0, 0), strfmt); bounds.ExpandToInclude(new RectangleD2D(position, _stringSize[i])); position = position.WithYPlus(_stringSize[i].Y * _lineSpacing); } _size = bounds.Size; }