Repository: flex-asjs Updated Branches: refs/heads/refactor-sprite 0d3ba9491 -> 3c7d7bc37
Set clip on svg, rather than the element contained in it. Helps eliminate transform conflicts. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3c7d7bc3 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3c7d7bc3 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3c7d7bc3 Branch: refs/heads/refactor-sprite Commit: 3c7d7bc37efe76ac7f92860d233d87a7955d9759 Parents: 0d3ba94 Author: yishayw <[email protected]> Authored: Tue Oct 25 12:45:36 2016 +0300 Committer: yishayw <[email protected]> Committed: Tue Oct 25 12:45:36 2016 +0300 ---------------------------------------------------------------------- .../Graphics/src/main/flex/org/apache/flex/svg/ClipBead.as | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c7d7bc3/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/ClipBead.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/ClipBead.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/ClipBead.as index beb792d..fb6d5fd 100644 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/ClipBead.as +++ b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/svg/ClipBead.as @@ -30,6 +30,10 @@ package org.apache.flex.svg import flash.display.DisplayObject; } + COMPILE::JS + { + import org.apache.flex.utils.UIDUtil; + } /** * The ClipBead bead allows you to clip * a graphic Shape using a an arbitrary graphic path. @@ -123,7 +127,7 @@ package org.apache.flex.svg var svgElement:Node = host.element as Element; var defs:Element = getChildNode(svgElement, "defs") as Element; var clipPath:Element = getChildNode(defs, "clipPath") as Element; - clipPath.id = "myClip"; // TODO UUID + clipPath.id = "myClip" + UIDUtil.createUID(); // clean up existing clip paths if (clipPath.hasChildNodes()) { @@ -137,8 +141,7 @@ package org.apache.flex.svg var pathNode:Element = createChildNode(clipPath, "path") as Element; pathNode.setAttribute("d", path.getPathString()); // set style - var content:Element = defs.previousSibling ? defs.previousSibling as Element : defs.nextSibling as Element; - (content.style as Object).clipPath = "url(#" + clipPath.id + ")"; + (host.element as Object).style.clipPath = "url(#" + clipPath.id + ")"; } COMPILE::JS
