public override Rect GetBarBounds(BarEntry e) #endif { IBarDataSet set = data.GetDataSetForEntry(e); if (set == null) { #if __ANDROID__ && !SKIASHARP outputRect.Set(float.MinValue, float.MinValue, float.MinValue, float.MinValue); return; #else return(Rect.Empty); #endif } float y = e.Y; float x = e.X; float barWidth = data.BarWidth; float top = x - barWidth / 2f; float bottom = x + barWidth / 2f; float left = y >= 0 ? y : 0; float right = y <= 0 ? y : 0; #if __ANDROID__ && !SKIASHARP outputRect.Set(left, top, right, bottom); GetTransformer(set.AxisDependency).RectValueToPixel(outputRect); #else var outputRect = new Rect(left, top, right, bottom); return(GetTransformer(set.AxisDependency).RectValueToPixel(outputRect)); #endif }
public static void MapRect(this Matrix3X3 matrix, ref SkiaSharp.SKRect rect) { var p1 = new Vector2((float)rect.Left, (float)rect.Top); var p2 = new Vector2((float)rect.Right, (float)rect.Top); var p3 = new Vector2((float)rect.Left, (float)rect.Bottom); var p4 = new Vector2((float)rect.Right, (float)rect.Bottom); p1 = matrix.Transform(p1); p2 = matrix.Transform(p2); p3 = matrix.Transform(p3); p4 = matrix.Transform(p4); var xMin = Math.Min(Math.Min(Math.Min(p1.X, p2.X), p3.X), p4.X); var xMax = Math.Max(Math.Max(Math.Max(p1.X, p2.X), p3.X), p4.X); var yMax = Math.Max(Math.Max(Math.Max(p1.Y, p2.Y), p3.Y), p4.Y); var yMin = Math.Min(Math.Min(Math.Min(p1.Y, p2.Y), p3.Y), p4.Y); RectExt.Set(ref rect, SkRectExpansion.CreateSkRect(new SkiaSharp.SKPoint(xMin, yMax), new SkiaSharp.SKPoint(xMax, yMin))); }
public override void GetBarBounds(BarEntry e, Rect outputRect)
/// <summary> /// The passed outputRect will be assigned the values of the bounding box of the specified Entry in the specified DataSet. /// The rect will be assigned Float.MIN_VALUE in all locations if the Entry could not be found in the charts data. /// </summary> /// <param name="e"></param> /// <returns></returns> #if __ANDROID__ && !SKIASHARP public virtual void GetBarBounds(BarEntry e, Rect outputRect)
public MenuStateMenuItemSkiaDrawData(SkiaSharp.SKRect pBounds, MenuStateMenuItem.StateMenuItemState pDrawState) { Bounds = pBounds; DrawState = pDrawState; }
public override void GetBounds(out SkiaSharp.SKRect outBounds, Matrix3X3 parentMatrix) { base.GetBounds(out outBounds, parentMatrix); RectExt.Set(ref outBounds, 0, 0, 0, 0); }
public static PixelFarm.Drawing.Rectangle ToRect(this SkiaSharp.SKRect rect) { return(new PixelFarm.Drawing.Rectangle((int)rect.Left, (int)rect.Top, (int)rect.Width, (int)rect.Height)); }
public static PixelFarm.Drawing.RectangleF ToRectF(this SkiaSharp.SKRect rect) { return(new PixelFarm.Drawing.RectangleF(rect.Left, rect.Top, rect.Width, rect.Height)); }
public static System.Windows.Rect ToRect(this SkiaSharp.SKRect rect) { }
public TetrisBlockDrawSkiaParameters(SkiaSharp.SKCanvas pG, SkiaSharp.SKRect pRegion, Nomino pGroupOwner, SettingsManager pSettings) : base(pGroupOwner, pSettings) { g = pG; region = pRegion; }