diff options
author | Arthur Taylor <theycallhimart@gmail.com> | 2007-03-21 02:22:10 +0000 |
---|---|---|
committer | Thomas James Alexander Thurman <tthurman@src.gnome.org> | 2007-03-21 02:22:10 +0000 |
commit | 11a90c53ed4b007b1658d6d24fc943adff130286 (patch) | |
tree | d8dade7641912791130433379f1c824769701d1f | |
parent | 88b91199d2228bf54a04fdedff47592ce07b7dfa (diff) | |
download | metacity-11a90c53ed4b007b1658d6d24fc943adff130286.tar.gz |
adjusted the rounded corners so that they fit nicely with the arcs around
2007-03-20 Arthur Taylor <theycallhimart@gmail.com>
* src/frames.c (meta_frames_apply_shapes): adjusted the rounded
corners so that they fit nicely with the arcs around them.
Fixes #399373.
svn path=/trunk/; revision=3120
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/frames.c | 32 |
2 files changed, 24 insertions, 14 deletions
@@ -1,3 +1,9 @@ +2007-03-20 Arthur Taylor <theycallhimart@gmail.com> + + * src/frames.c (meta_frames_apply_shapes): adjusted the rounded + corners so that they fit nicely with the arcs around them. + Fixes #399373. + 2007-03-17 Kjartan Maraas <kmaraas@gnome.org> * src/ui.c: Remove #include <pango/pangox.h> since it's diff --git a/src/frames.c b/src/frames.c index aac8a790..874fb842 100644 --- a/src/frames.c +++ b/src/frames.c @@ -788,12 +788,13 @@ meta_frames_apply_shapes (MetaFrames *frames, if (fgeom.top_left_corner_rounded_radius != 0) { - const int radius = fgeom.top_left_corner_rounded_radius; + const int corner = fgeom.top_left_corner_rounded_radius; + const float radius = sqrt(corner) + corner; int i; - for (i=0; i<radius; i++) + for (i=0; i<corner; i++) { - const int width = 1 + (radius - floor(sqrt(radius*radius - (radius-i)*(radius-i)) + 0.5)); + const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5)))); xrect.x = 0; xrect.y = i; xrect.width = width; @@ -805,12 +806,13 @@ meta_frames_apply_shapes (MetaFrames *frames, if (fgeom.top_right_corner_rounded_radius != 0) { - const int radius = fgeom.top_right_corner_rounded_radius; + const int corner = fgeom.top_right_corner_rounded_radius; + const float radius = sqrt(corner) + corner; int i; - for (i=0; i<radius; i++) + for (i=0; i<corner; i++) { - const int width = 1 + (radius - floor(sqrt(radius*radius - (radius-i)*(radius-i)) + 0.5)); + const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5)))); xrect.x = new_window_width - width; xrect.y = i; xrect.width = width; @@ -822,14 +824,15 @@ meta_frames_apply_shapes (MetaFrames *frames, if (fgeom.bottom_left_corner_rounded_radius != 0) { - const int radius = fgeom.bottom_left_corner_rounded_radius; + const int corner = fgeom.bottom_left_corner_rounded_radius; + const float radius = sqrt(corner) + corner; int i; - for (i=0; i<radius; i++) + for (i=0; i<corner; i++) { - const int width = 1 + (radius - floor(sqrt(radius*radius - (radius-i)*(radius-i)) + 0.5)); + const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5)))); xrect.x = 0; - xrect.y = new_window_height - i; + xrect.y = new_window_height - i - 1; xrect.width = width; xrect.height = 1; @@ -839,14 +842,15 @@ meta_frames_apply_shapes (MetaFrames *frames, if (fgeom.bottom_right_corner_rounded_radius != 0) { - const int radius = fgeom.bottom_right_corner_rounded_radius; + const int corner = fgeom.bottom_right_corner_rounded_radius; + const float radius = sqrt(corner) + corner; int i; - for (i=0; i<radius; i++) + for (i=0; i<corner; i++) { - const int width = 1 + (radius - floor(sqrt(radius*radius - (radius-i)*(radius-i)) + 0.5)); + const int width = floor(0.5 + radius - sqrt(radius*radius - (radius-(i+0.5))*(radius-(i+0.5)))); xrect.x = new_window_width - width; - xrect.y = new_window_height - i; + xrect.y = new_window_height - i - 1; xrect.width = width; xrect.height = 1; |