Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 054a17ca authored by ztenghui's avatar ztenghui
Browse files

Limit the scope of clip path to the group, not global

http://b/18758765

Change-Id: I899401a5fcbccd0421687bd5cf671f7751092195
parent a1d11273
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -913,9 +913,10 @@ public class VectorDrawable extends Drawable {
            // Basically the Mfinal = Mviewport * M0 * M1 * M2;
            // Mi the local matrix at level i of the group tree.
            currentGroup.mStackedMatrix.set(currentMatrix);

            currentGroup.mStackedMatrix.preConcat(currentGroup.mLocalMatrix);

            // Save the current clip information, which is local to this group.
            canvas.save();
            // Draw the group tree in the same order as the XML file.
            for (int i = 0; i < currentGroup.mChildren.size(); i++) {
                Object child = currentGroup.mChildren.get(i);
@@ -928,6 +929,7 @@ public class VectorDrawable extends Drawable {
                    drawPath(currentGroup, childPath, canvas, w, h, filter);
                }
            }
            canvas.restore();
        }

        public void draw(Canvas canvas, int w, int h, ColorFilter filter) {
+24 −16
Original line number Diff line number Diff line
@@ -15,9 +15,9 @@
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="64dp"
        android:width="64dp"
    android:viewportHeight="12.25"
        android:viewportWidth="7.30625" >
    android:viewportWidth="7.30625"
    android:width="64dp" >

    <group
        android:pivotX="3.65"
@@ -31,8 +31,11 @@
                l 0, 12.25
                l-7.3, 0
                z" />
    </group>
    <group>

        <group
            android:pivotX="3.65"
            android:pivotY="6.125"
            android:rotation="30" >
            <path
                android:name="one"
                android:fillColor="#ff88ff"
@@ -40,6 +43,7 @@
                l 2.09375-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0
                l-5.046875,0.0 0.0-1.0Z" />
        </group>
    </group>
    <group
        android:pivotX="3.65"
        android:pivotY="6.125"
@@ -52,8 +56,11 @@
                l 0, 6.125
                l-7.3, 0
                z" />
    </group>
    <group>

        <group
            android:pivotX="3.65"
            android:pivotY="6.125"
            android:rotation="30" >
            <path
                android:name="two"
                android:fillColor="#ff88ff"
@@ -67,5 +74,6 @@
                        q-0.203125,0.484375-0.734375,1.140625-0.15625,0.171875-0.9375,0.984375
                        q-0.78125024,0.8125-2.2187502,2.265625Z" />
        </group>
    </group>

</vector>
 No newline at end of file