projects
/
screensavers
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
280460e
)
In NEDsim, display as many data rows as possible instead of a power-of-two.
author
Aaron Taylor
<ataylor@subgeniuskitty.com>
Sat, 10 Jul 2021 22:56:01 +0000
(15:56 -0700)
committer
Aaron Taylor
<ataylor@subgeniuskitty.com>
Sat, 10 Jul 2021 22:56:01 +0000
(15:56 -0700)
hacks/NEDsim/NEDsim.c
patch
|
blob
|
blame
|
history
diff --git
a/hacks/NEDsim/NEDsim.c
b/hacks/NEDsim/NEDsim.c
index
c6c7c3d
..
8331334
100644
(file)
--- a/
hacks/NEDsim/NEDsim.c
+++ b/
hacks/NEDsim/NEDsim.c
@@
-799,8
+799,8
@@
NEDsim_init(Display * dpy, Window win)
int available_space_for_data_rows = nedsim->dpy_height -
(nedsim->cell_size * (HEADER_HEIGHT_IN_CELLS + FOOTER_HEIGHT_IN_CELLS));
for (int i = 0; ; i++) {
- if ((nedsim->cell_size *
(1 << i)
) > available_space_for_data_rows) {
- nedsim->num_data_rows =
(1 << --i)
;
+ if ((nedsim->cell_size *
i
) > available_space_for_data_rows) {
+ nedsim->num_data_rows =
--i
;
break;
}
}