/// <summary> /// Adjusts the point to scope canvas origin of the scope node /// </summary> /// <param name="pointToAdjust">The point to adjust.</param> /// <param name="scopeNode">The scope node.</param> /// <param name="topCanvasOffset">The top canvas offset - represents the offset from top border of the scope to start of the inside canvas. </param> /// <param name="scopeCenter">The scope center.</param> /// <returns></returns> private static Point AdjustPointToScopeCanvasOrigin(Point pointToAdjust, TraceLab.Core.Experiments.ScopeNodeBase scopeNode, double topCanvasOffset, ref Point scopeCenter) { Point originCanvasPoint = GetOriginCanvasPoint(scopeNode, topCanvasOffset, ref scopeCenter); Point adjustedPoint = AdjustPointToGivenOriginPoint(pointToAdjust, ref originCanvasPoint); return(adjustedPoint); }
/// <summary> /// Gets the point of top border center with a given padding to border /// </summary> /// <param name="scopeNode">The scope node.</param> /// <param name="paddingBottom">The padding from top border.</param> /// <param name="topCanvasOffset">The top canvas offset - scope may have label, thus graph canvas is off by some amount from top.</param> /// <returns>top border center</returns> public static Point GetTopBorderCenter(TraceLab.Core.Experiments.ScopeNodeBase scopeNode, double paddingTop, double topCanvasOffset) { Point scopeCenter = new Point(scopeNode.Data.X, scopeNode.Data.Y); Point topBorderCenter = new Point(scopeCenter.X, scopeCenter.Y - scopeNode.DataWithSize.Height / 2 + paddingTop + topCanvasOffset); Point adjustedPoint = AdjustPointToScopeCanvasOrigin(topBorderCenter, scopeNode, topCanvasOffset, ref scopeCenter); return(adjustedPoint); }
/// <summary> /// Gets the origin canvas point of the scope /// </summary> /// <param name="scopeNode">The scope node.</param> /// <param name="topCanvasOffset">The top canvas offset.</param> /// <param name="scopeCenter">The scope center.</param> /// <returns></returns> private static Point GetOriginCanvasPoint(TraceLab.Core.Experiments.ScopeNodeBase scopeNode, double topCanvasOffset, ref Point scopeCenter) { Point originCanvasPoint = new Point(scopeCenter.X - scopeNode.DataWithSize.Width / 2, scopeCenter.Y - scopeNode.DataWithSize.Height / 2 + topCanvasOffset); return(originCanvasPoint); }