[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] edje gradient fill



A few weeks back, I added gradient support to edje. However, I think I
need to rework how thigns are done slightly. Here's the issue:

Evas applies the fill of a grad BEFORE the rotation due to the angle.
So, if you want a horizontal grad from left to right (angle = 270) you
need to evas_object_gradient_fill(grad, 0, 0, h, w);  [ e.g. flip the w
and h params ].

Now, due to the way edje does fills (specify origin and size), you can't
easily do this. So, here's what I propose:

Do away with the angle parameter.
Use the origin/size to specify the angle AND fill.

So, for a horizontal linear gradient that fills the object, you would have:

  fill {
    origin {
      relative: 0 0;
      offset: 0 0;
    }
    size {
      relative: 1 0;
      offset: -1 0;
    }
  }


To fill diagonally down from top left to bottom right it would be: 

  fill {
    origin {
      relative: 0 0;
      offset: 0 0;
    }
    size {
      relative: 1 1;
      offset: -1 -1;
    }
  }

(with the current setup, this isn't even possible)

Any objections?

rephorm