After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 321278 - Lack of control for gradients (diagonal and radial)
Lack of control for gradients (diagonal and radial)
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: themes
2.12.x
Other All
: Normal enhancement
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks: 102547
 
 
Reported: 2005-11-12 01:42 UTC by Luke Morton
Modified: 2006-03-23 00:40 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
top-right -> bottom-left diagonal gradient (610 bytes, patch)
2005-11-13 05:39 UTC, Daniel
none Details | Review
meta_gradient_create_radial (2.29 KB, patch)
2005-11-13 15:32 UTC, Daniel
none Details | Review

Description Luke Morton 2005-11-12 01:42:40 UTC
1. It is impossible to create a gradient from top-right to bottom-left. All
diagonal gradients move from top-left to bottom-right. It would be nice if
gradients could be controlled by specifying an origin(x, y) and destination(x2,
y2). This would also alleviate the need to specify horizontal, vertical or
diagonal as all these gradients would simply be linear.

2. Radial gradients would be a nice addition (particuarly when using rounded
corners). Radial graidents could use the same origin and destination values as
linear gradients with the origin being the centre of a circle and the
destination being any point on the circumference. As an added feature, an origin
offset(angle, distance) could be added to allow the focus of the gradient to be
shifted. Finally, adding an attribute for the number of degrees to draw from the
destination could allow for non-round shapes (think pacman).
Comment 1 Daniel 2005-11-13 05:39:30 UTC
Created attachment 54691 [details] [review]
top-right -> bottom-left diagonal gradient

Shouldn't be included with the metacity source - it is only intended to
demonstrate how these types of gradients can be created.
Comment 2 Daniel 2005-11-13 05:43:32 UTC
At the moment, the function that creates diagonal gradients
[meta_gradient_create_diagonal()] works by creating a 1 pixel high horizontal
gradient [with meta_gradient_create_horizontal()] which is then copied to the
following rows with an increasing offset.  The attatched patch to gradient.c 
instead decrements the offset to give a top-right -> bottom-left gradient. 

To create the more generic gradients that the bug reporter seeks
meta_gradient_create_diagonal() and meta_gradient_create_multi_diagonal() will
have to be made much more generic so that they don't just memcpy() sections of a
linear horizontal gradient.  Will this result in an unacceptable performance
loss?  Are title bar regions recreated for every Expose event or is the same
GdkPixbuf reused each time?
Comment 3 Daniel 2005-11-13 15:32:35 UTC
Created attachment 54704 [details] [review]
meta_gradient_create_radial

This patch adds a function called meta_gradient_create_radial to gradient.c
Comment 4 Thomas Thurman 2006-03-23 00:40:48 UTC
Bug 107012 lets us use any gradient that SVG supports, which is pretty much anything there is. In particular, use of diagonal and radial gradients is demonstrated in attachment 61813 [details].

-> FIXED