summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Taylor <theycallhimart@gmail.com>2007-04-09 01:44:42 +0000
committerThomas James Alexander Thurman <tthurman@src.gnome.org>2007-04-09 01:44:42 +0000
commit9d87496f1078b5d993a5455b402041b98e3bbc0e (patch)
treed65c132d1c2252919937bdce28466430b4b80bc5
parentdbc43b9f00821ce9cf32cf913f1f199de4214c6c (diff)
downloadmetacity-9d87496f1078b5d993a5455b402041b98e3bbc0e.tar.gz
adjusted the rounded corners so that they fit nicely with the arcs around
2007-04-08 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=/branches/gnome-2-18/; revision=3177
-rw-r--r--ChangeLog6
-rw-r--r--src/frames.c32
2 files changed, 24 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 5777629b..2fd8c8b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-08 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-04-04 Elijah Newren <newren gmail com>
* configure.in: post-release version bump to 2.18.2
diff --git a/src/frames.c b/src/frames.c
index d6e953b8..caceb709 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;