OSDN Git Service
(root)
/
molby
/
Molby.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d87978f
)
Fix the horizontal scale of Show Energy window
author
Toshi Nagata
<alchemist.2005@nifty.com>
Sat, 1 Oct 2022 06:43:36 +0000
(15:43 +0900)
committer
Toshi Nagata
<alchemist.2005@nifty.com>
Sat, 1 Oct 2022 06:43:36 +0000
(15:43 +0900)
Scripts/commands.rb
patch
|
blob
|
history
diff --git
a/Scripts/commands.rb
b/Scripts/commands.rb
index
563d4de
..
ee4c7ab
100755
(executable)
--- a/
Scripts/commands.rb
+++ b/
Scripts/commands.rb
@@
-278,8
+278,14
@@
class Molecule
max = wave_max.call
h = max - min
h = (h == 0.0 ? 1.0 : height / h)
- w = wave.count
- w = (w == 0 ? 1.0 : Float(width) / w)
+ c = wave.count
+ if c == 0
+ w = 1.0
+ elsif c == 1
+ w = Float(width)
+ else
+ w = Float(width) / (c - 1)
+ end
lines = []
a = []
# Skip the points that have exactly 0.0 value