clear rectangle in shadow
This commit is contained in:
parent
b31a2b48a1
commit
75b0d38725
29
compton.c
29
compton.c
|
@ -578,6 +578,7 @@ make_shadow(Display *dpy, double opacity,
|
||||||
* center (fill the complete data array)
|
* center (fill the complete data array)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (Gsize > 0) {
|
if (Gsize > 0) {
|
||||||
d = shadow_top[opacity_int * (Gsize + 1) + Gsize];
|
d = shadow_top[opacity_int * (Gsize + 1) + Gsize];
|
||||||
} else {
|
} else {
|
||||||
|
@ -586,6 +587,10 @@ make_shadow(Display *dpy, double opacity,
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(data, d, sheight * swidth);
|
memset(data, d, sheight * swidth);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// zero the pixmap
|
||||||
|
memset(data, 0, sheight * swidth);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* corners
|
* corners
|
||||||
|
@ -616,6 +621,10 @@ make_shadow(Display *dpy, double opacity,
|
||||||
* top/bottom
|
* top/bottom
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// shadow_radius is 12 by default
|
||||||
|
// this makes gsize 36 by default
|
||||||
|
//ylimit -= (shadow_radius + 4);
|
||||||
|
|
||||||
x_diff = swidth - (gsize * 2);
|
x_diff = swidth - (gsize * 2);
|
||||||
if (x_diff > 0 && ylimit > 0) {
|
if (x_diff > 0 && ylimit > 0) {
|
||||||
for (y = 0; y < ylimit; y++) {
|
for (y = 0; y < ylimit; y++) {
|
||||||
|
@ -630,10 +639,15 @@ make_shadow(Display *dpy, double opacity,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ylimit = gsize;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* sides
|
* sides
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//xlimit -= (shadow_radius + 4);
|
||||||
|
//gsize = 16;
|
||||||
|
|
||||||
for (x = 0; x < xlimit; x++) {
|
for (x = 0; x < xlimit; x++) {
|
||||||
if (xlimit == Gsize) {
|
if (xlimit == Gsize) {
|
||||||
d = shadow_top[opacity_int * (Gsize + 1) + x];
|
d = shadow_top[opacity_int * (Gsize + 1) + x];
|
||||||
|
@ -647,6 +661,19 @@ make_shadow(Display *dpy, double opacity,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// zero extra pixels
|
||||||
|
//int r = shadow_radius;
|
||||||
|
//int sr = r + 4;
|
||||||
|
//int er = r + 8;
|
||||||
|
int r = gsize / 2;
|
||||||
|
int sr = r - 2;
|
||||||
|
int er = r + 2;
|
||||||
|
for (y = sr; y < (sheight - er); y++) {
|
||||||
|
for (x = sr; x < (swidth - er); x++) {
|
||||||
|
data[y * swidth + x] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ximage;
|
return ximage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -878,6 +905,7 @@ win_extents(Display *dpy, win *w) {
|
||||||
if (!w->shadow) {
|
if (!w->shadow) {
|
||||||
double opacity = shadow_opacity;
|
double opacity = shadow_opacity;
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (w->mode != WINDOW_SOLID) {
|
if (w->mode != WINDOW_SOLID) {
|
||||||
opacity = opacity * ((double)w->opacity) / ((double)OPAQUE);
|
opacity = opacity * ((double)w->opacity) / ((double)OPAQUE);
|
||||||
}
|
}
|
||||||
|
@ -885,6 +913,7 @@ win_extents(Display *dpy, win *w) {
|
||||||
if (HAS_FRAME_OPACITY(w)) {
|
if (HAS_FRAME_OPACITY(w)) {
|
||||||
opacity = opacity * frame_opacity;
|
opacity = opacity * frame_opacity;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
w->shadow = shadow_picture(
|
w->shadow = shadow_picture(
|
||||||
dpy, opacity, w->alpha_pict,
|
dpy, opacity, w->alpha_pict,
|
||||||
|
|
Loading…
Reference in New Issue