private void DrawGlyph(Path path, Paint paint, BitmapCanvas canvas) { if (paint.Color == Colors.Transparent) { return; } if (paint.Style == Paint.PaintStyle.Stroke && paint.StrokeWidth == 0) { return; } canvas.DrawPath(path, paint); }
public override void DrawLayer(BitmapCanvas canvas, Matrix3X3 parentMatrix, byte parentAlpha) { int backgroundAlpha = LayerModel.SolidColor.A; if (backgroundAlpha == 0) { return; } var alpha = (byte)(parentAlpha / 255f * (backgroundAlpha / 255f * Transform.Opacity.Value / 100f) * 255); _paint.Alpha = alpha; if (_colorFilterAnimation != null) { _paint.ColorFilter = _colorFilterAnimation.Value; } if (alpha > 0) { _points[0] = new Vector2(0, 0); _points[1] = new Vector2(LayerModel.SolidWidth, 0); _points[2] = new Vector2(LayerModel.SolidWidth, LayerModel.SolidHeight); _points[3] = new Vector2(0, LayerModel.SolidHeight); // We can't map RectangleF here because if there is rotation on the transform then we aren't // actually drawing a rect. parentMatrix.MapPoints(ref _points); _path.Reset(); _path.MoveTo(_points[0].X, _points[0].Y); _path.LineTo(_points[1].X, _points[1].Y); _path.LineTo(_points[2].X, _points[2].Y); _path.LineTo(_points[3].X, _points[3].Y); _path.LineTo(_points[0].X, _points[0].Y); _path.Close(); canvas.DrawPath(_path, _paint); } }