Xinqi Bao's Git
projects
/
dwm.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
2ddc787
)
simplification
author
Anselm R. Garbe <
[email protected]
>
Tue, 6 Feb 2007 14:28:25 +0000
(15:28 +0100)
committer
Anselm R. Garbe <
[email protected]
>
Tue, 6 Feb 2007 14:28:25 +0000
(15:28 +0100)
client.c
patch
|
blob
|
history
diff --git
a/client.c
b/client.c
index
2b194d7
..
6d88222
100644
(file)
--- a/
client.c
+++ b/
client.c
@@
-9,13
+9,6
@@
/* static */
/* static */
-static void
-closestpt(float *rx, float *ry, float x, float y, float grad) {
- float u = (x * grad + y) / (grad * grad + 1);
- *rx = u * grad;
- *ry = u;
-}
-
static void
detachstack(Client *c) {
Client **tc;
static void
detachstack(Client *c) {
Client **tc;
@@
-191,7
+184,7
@@
manage(Window w, XWindowAttributes *wa) {
void
resize(Client *c, Bool sizehints) {
void
resize(Client *c, Bool sizehints) {
- float
dx, dy, min, max, actual
;
+ float
actual, dx, dy, max, min, u
;
XWindowChanges wc;
if(c->w <= 0 || c->h <= 0)
XWindowChanges wc;
if(c->w <= 0 || c->h <= 0)
@@
-214,12
+207,14
@@
resize(Client *c, Bool sizehints) {
actual = dx / dy;
if(max > 0 && min > 0 && actual > 0) {
if(actual < min) {
actual = dx / dy;
if(max > 0 && min > 0 && actual > 0) {
if(actual < min) {
- closestpt(&dx, &dy, dx, dy, min);
+ dy = (dx * min + dy) / (min * min + 1);
+ dx = dy * min;
c->w = (int)dx + c->basew;
c->h = (int)dy + c->baseh;
}
else if(actual > max) {
c->w = (int)dx + c->basew;
c->h = (int)dy + c->baseh;
}
else if(actual > max) {
- closestpt(&dx, &dy, dx, dy, max);
+ dy = (dx * min + dy) / (max * max + 1);
+ dx = dy * min;
c->w = (int)dx + c->basew;
c->h = (int)dy + c->baseh;
}
c->w = (int)dx + c->basew;
c->h = (int)dy + c->baseh;
}