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

Commit 9b559989 authored by Chet Haase's avatar Chet Haase
Browse files

Fix shift/mask error in ArtbEvaluator

Shifting from the left copies the MSB along with it. This causes a problem
in ArgbEvaluator, which shifts the top byte down by 24 for the start/end
colors, and then uses those values to interpolate alpha values. The correct
appraoch (used with the other color components) is to mask by 0xff after the
shift.

Issue #6960514 External bug: ArgbEvaluator can't evaluate alpha value properly

Change-Id: I750d38ddfecc5f30d8dab7c6d27d1a7ac06361c3
parent 7c46e438
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -40,13 +40,13 @@ public class ArgbEvaluator implements TypeEvaluator {
     */
    public Object evaluate(float fraction, Object startValue, Object endValue) {
        int startInt = (Integer) startValue;
        int startA = (startInt >> 24);
        int startA = (startInt >> 24) & 0xff;
        int startR = (startInt >> 16) & 0xff;
        int startG = (startInt >> 8) & 0xff;
        int startB = startInt & 0xff;

        int endInt = (Integer) endValue;
        int endA = (endInt >> 24);
        int endA = (endInt >> 24) & 0xff;
        int endR = (endInt >> 16) & 0xff;
        int endG = (endInt >> 8) & 0xff;
        int endB = endInt & 0xff;