summaryrefslogtreecommitdiffstats
path: root/hacks/crystal.c
diff options
context:
space:
mode:
authorSimon Rettberg2021-04-06 14:43:39 +0200
committerSimon Rettberg2021-04-07 13:38:37 +0200
commit38886de0c3e9ea5729ef23e4c653fa2822f52e8f (patch)
tree9b799c8c968a92cc77746a95e0e8bdd90b6b13c3 /hacks/crystal.c
parentMaybe not remove, but ... (diff)
downloadxscreensaver-openslx.tar.gz
xscreensaver-openslx.tar.xz
xscreensaver-openslx.zip
xscreensaver 6.00v28r1openslx
Diffstat (limited to 'hacks/crystal.c')
-rw-r--r--hacks/crystal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hacks/crystal.c b/hacks/crystal.c
index 9f33529..e82492c 100644
--- a/hacks/crystal.c
+++ b/hacks/crystal.c
@@ -1142,8 +1142,9 @@ init_crystal(ModeInfo * mi)
cryst->offset_h = (int) ((cryst->win_height - cryst->b * cos((
cryst->gamma - 90) * PI_RAD)) / 2.0);
if (!centre) {
+ int n2 = (2 * cryst->offset_h);
if (cryst->offset_h > 0)
- cryst->offset_h = NRAND(2 * cryst->offset_h);
+ cryst->offset_h = NRAND(n2);
cryst->offset_w = (int) (cryst->win_width - cryst->a -
cryst->b *
fabs(sin((cryst->gamma - 90) * PI_RAD)));