public static void CalculateMouseValue(IGaugeContainer container, IConvertibleScaleEx scale, MouseEventArgs e) { BasePrimitiveHitInfo hi = container.CalcHitInfo(e.Location); if (hi.Element != null && !hi.Element.IsComposite) { PointF modelPt = MathHelper.PointToModelPoint(scale as DevExpress.XtraGauges.Core.Base.IElement <IRenderableElement>, new PointF(e.X, e.Y)); float percent = scale.PointToPercent(modelPt); scale.Value = scale.PercentToValue(percent); } }
float CalculateMouseValue(IGaugeContainer container, IConvertibleScaleEx scale, MouseEventArgs e) { float result = -1; BasePrimitiveHitInfo hi = container.CalcHitInfo(e.Location); if (hi.Element != null) { PointF modelPt = MathHelper.PointToModelPoint(scale as IElement <IRenderableElement>, hi.HitPoint); float percent = scale.PointToPercent(modelPt); result = scale.PercentToValue(percent); } return(result); }