Пример #1
0
        public static void SetClipperCanvas(this EvasObject target, SKClipperView clipper)
        {
            if (target != null && clipper.ClippingRequired)
            {
                var realHandle = elm_object_part_content_get(clipper, "elm.swallow.content");

                target.SetClip(null);                 // To restore original image
                evas_object_clip_set(target, realHandle);
            }
        }
Пример #2
0
        internal static void ApplyRotation(this IView view, EvasObject platformView, EvasMap map, Rect geometry, ref bool changed)
        {
            var rotationX = view.RotationX;
            var rotationY = view.RotationY;
            var rotationZ = view.Rotation;
            var anchorX   = view.AnchorX;
            var anchorY   = view.AnchorY;

            // apply rotations
            if (rotationX != 0 || rotationY != 0 || rotationZ != 0)
            {
                map.Rotate3D(rotationX, rotationY, rotationZ, (int)(geometry.X + geometry.Width * anchorX),
                             (int)(geometry.Y + geometry.Height * anchorY), 0);
                // the last argument is focal length, it determine the strength of distortion. We compared it with the Android implementation
                map.Perspective3D(geometry.X + geometry.Width / 2, geometry.Y + geometry.Height / 2, 0, (int)(1.3 * Math.Max(geometry.Height, geometry.Width)));
                // Need to unset clip because perspective 3d rotation is going beyond the container bound
                platformView.SetClip(null);
                changed = true;
            }
        }