/// <summary> /// Draws the lines of a cursor tick. /// </summary> private void DrawCursorTickLines(RectangleRange rectangleRange, ScopeCursorValueTick tick, PointD tickPosition, ScopeCursorLines tickLines, Color color) { var userToDeviceMatrix = rectangleRange.Matrix; var cursorTickHalfUserLengths = userToDeviceMatrix.TransformDistanceInverse(_cursorTickLength / 2, _cursorTickLength / 2); using (CreateContextState()) { Context.SetSourceColor(color); using (CreateContextState(userToDeviceMatrix)) { if ((tickLines & ScopeCursorLines.X) != ScopeCursorLines.None) { AddLinePath(new PointD(tickPosition.X, tickPosition.Y - cursorTickHalfUserLengths.Dy), new PointD(tickPosition.X, tickPosition.Y + cursorTickHalfUserLengths.Dy)); } } using (CreateContextState(userToDeviceMatrix)) { if ((tickLines & ScopeCursorLines.Y) != ScopeCursorLines.None) { AddLinePath(new PointD(tickPosition.X - cursorTickHalfUserLengths.Dx, tickPosition.Y), new PointD(tickPosition.X + cursorTickHalfUserLengths.Dx, tickPosition.Y)); } } Context.LineWidth = _cursorTickLineWidth; Context.Stroke(); } }
/// <summary> /// Initializes an instance of this class. /// </summary> /// <param name="position">The position.</param> /// <param name="lines">A value indicating which lines are visible.</param> /// <param name="lineWeight">The weight of the cursor lines.</param> /// <param name="selectableLines">A value indicating which lines are selectable.</param> /// <param name="color">The cursor color.</param> /// <param name="markers">A value indicating which markers are visible.</param> /// <param name="captions">A list of captions.</param> public ScopeCursor(ScopePosition position, ScopeCursorLines lines, ScopeCursorLineWeight lineWeight, ScopeCursorLines selectableLines, Color color, ScopeCursorMarkers markers, IEnumerable <ScopePositionCaption> captions) { Position = position; Lines = lines; LineWeight = lineWeight; HighlightedLines = ScopeCursorLines.None; SelectableLines = selectableLines; Color = color; Markers = markers; Captions = captions; }
/// <summary> /// Initializes an instance of this class. /// </summary> /// <param name="cursor">The cursor this object belongs to.</param> /// <param name="selectedLines">A value indicating which lines are selected.</param> public ScopeCursorSelection(ScopeCursor cursor, ScopeCursorLines selectedLines) { Cursor = cursor; SelectedLines = selectedLines; }