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

Re: [E-devel] edje gradient fill



> All this solves one issue (specifying a 'dynamic' angle
> e.g. corner to corner) but still doesnt' solve the main issue
> I had. Namely: Draw a horizontal linear gradient completely
> filling its bounding rectangle.

	The bounding rect of an (unrotated) gradient object is
the gradient obj's rect, no matter the fill region or fill angle.
If you want a horz lin grad 'filling' the grad obj then you
would set the fill height to the obj's width and set the fill
angle to -90.
	If you want a lin grad object which has its fill 'from
point a to point b' then you set the fill height to be the dist
from a to b and the fill angle to be the arctan of the slope from
a to b. This is a very standard sort of procedure - replacing two
points by a distance and an angle.

	If you were texturing a rect obj with a lin grad object
then you'd have a bit more flexibility since you then have two
coord systems to refer to, the rect's and the grad's.. but you
still have to do something like the above.. That's the way it has
to be if you want only ONE notion of a linear grad, rel to ONE
orientation, and rel to ONE method of specifying a fill that works
for ALL texturing notions.
	So, if you want some simple way to get what you're after
for lin grads within this general context, then maybe what you
have now would be the way..
	Just keep in mind that you are now introducing notions
that refer to transformations like rotations, multiple objects
that may refer to each other with each at differing sizes and
rotations, etc..  This is never a simple thing to deal with,
especially since scaling and rotating don't commute in general.