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 121603 - arc is strange, undocumented, and shown with poor examples
arc is strange, undocumented, and shown with poor examples
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: themes
2.4.x
Other Linux
: Normal normal
: future
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks: 102547
 
 
Reported: 2003-09-06 10:29 UTC by Gregory Merchan
Modified: 2006-10-07 17:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Gregory Merchan 2003-09-06 10:29:32 UTC
The arc drawing operation expects angles between 0 and 1 instead of degrees
or grads (radians would be hell). The 0 is at 6 o'clock, though the comment
in theme.c claims 12 o'clock. Neither the angle units nor the 0 angle is
documented. The examples provided in theme-format.txt and the tutorial
show angle values 30 and 180, which would imply degrees are expected. The
counter-clockwise drawing direction should perhaps be documented, even
though it's to be expected.
Comment 1 Havoc Pennington 2003-09-26 02:56:16 UTC
It's basically just XDrawArc() IIRC
Comment 2 Gregory Merchan 2003-09-26 04:14:57 UTC
Nah, that's the strange part. ;-) It does call gdk_draw_arc() which
calls XDrawArc() and those have the same semantics, but the values
from the theme aren't fed directly to the function.

The offending code is in the function meta_draw_op_draw_with_env()
in theme.c, lines 3285-3291:

gdk_draw_arc (drawable,
              gc,
              op->data.arc.filled,
              rx, ry, rwidth, rheight,
              op->data.arc.start_angle * (360.0 * 64.0) -
              (90.0 * 64.0), /* start at 12 instead of 3 oclock */
              op->data.arc.extent_angle * (360.0 * 64.0));

It's easy to fix, but I don't know what to fix it to. I'd need to
know what the theme-writer's documentation should give as:
 1) the 0 angle,
 2) the drawing direction, and
 3) the angle measurement.
Comment 3 Thomas Thurman 2006-02-15 19:10:34 UTC
Did anyone come up with any ideas as to what to fix it to?

It looks like it would be quite easy to make optional attributes "start_degrees" and "extent_degrees" which could be used instead of "start_angle" and "extent_angle", if that's what people would prefer.
Comment 4 Thomas Thurman 2006-10-07 17:02:50 UTC
Fixed in HEAD!