projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.38.tar.gz
[xscreensaver]
/
hacks
/
attraction.c
diff --git
a/hacks/attraction.c
b/hacks/attraction.c
index 331cbcf8e5b8f73a34d053900864e4faa8ce9a3b..4fe22c237e00c6147b557af5dd0ad29d418eb790 100644
(file)
--- a/
hacks/attraction.c
+++ b/
hacks/attraction.c
@@
-162,6
+162,7
@@
attraction_init (Display *dpy, Window window)
double th;
Colormap cmap;
char *mode_str, *graph_mode_str;
double th;
Colormap cmap;
char *mode_str, *graph_mode_str;
+ double size_scale;
XGetWindowAttributes (dpy, window, &xgwa);
st->xlim = xgwa.width;
XGetWindowAttributes (dpy, window, &xgwa);
st->xlim = xgwa.width;
@@
-342,8
+343,12
@@
attraction_init (Display *dpy, Window window)
jwxyz_XSetAntiAliasing (dpy, st->erase_gc, False);
#endif
jwxyz_XSetAntiAliasing (dpy, st->erase_gc, False);
#endif
+ size_scale = 3;
+ if (xgwa.width < 100 || xgwa.height < 100) /* tiny windows */
+ size_scale = 0.75;
+
/* let's make the balls bigger by default */
/* let's make the balls bigger by default */
-#define rand_size() (
3
* (8 + (random () % 7)))
+#define rand_size() (
size_scale
* (8 + (random () % 7)))
if (st->orbit_p && !st->global_size)
/* To orbit, all objects must be the same mass, or the math gets
if (st->orbit_p && !st->global_size)
/* To orbit, all objects must be the same mass, or the math gets