Пример #1
0
        public (IComponent[], IAsset[]) Render(XdObjectJson xdObject, Obb obb, XdAssetHolder assetHolder)
        {
            var(imageComponent, assets) = ShapeObjectParser.RenderImage(xdObject, obb, assetHolder);

            IComponent scrollbar = new VerticalScrollbarComponent(imageComponent);

            if (xdObject.HasParameter("horizontal"))
            {
                scrollbar = new HorizontalScrollbarComponent(imageComponent);
            }
            return(new[] { scrollbar }, assets);
        }
Пример #2
0
        public (IComponent[], IAsset[]) Render(XdObjectJson xdObject, XdAssetHolder assetHolder, IObbGetter obbGetter)
        {
            var obb      = obbGetter.Get(xdObject);
            var clipPath = xdObject.Meta.Ux.ClipPathResources.Children[0];

            if (SvgUtil.IsAlphaOnly(clipPath))
            {
                return(new IComponent[] { }, new IAsset[] { });
            }

            var(imageComponent, assets) = ShapeObjectParser.RenderImage(clipPath, obb, assetHolder);
            return(new IComponent[] { new MaskComponent(imageComponent.Sprite) }, assets);
        }