Skip to content

Commit

Permalink
client: add tolerance for grid lines and labels at edge of window.
Browse files Browse the repository at this point in the history
If a grid line is very close to the right edge of the window, display
it; this looks better when stepping through a record with a
non-integer sampling frequency.

Similarly, display the elapsed-time label if it appears very close to
the edge of the window.
  • Loading branch information
Benjamin Moody committed Jun 21, 2022
1 parent 2925bc0 commit cfd2875
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/js/lightwave.js
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ function show_plot() {
+ '" d="M' + x0r + ',0 ';
uparrow = ' l-' + adx1 + ',' + ady1 + 'l' + adx2 + ',0 l-' + adx1
+ ',-' + ady1 + 'm' + griddx + ',-';
for (x = 0; x + x0r <= svgw; x += griddx) {
for (x = 0; x + x0r <= svgw + 0.01 * griddx; x += griddx) {
if (x%tscl === x0q) { grd += 'l0,' + svgh + uparrow + svgh; }
else { grd += 'l0,' + svgh + ' m' + griddx + ',-' + svgh; }
}
Expand All @@ -1109,7 +1109,7 @@ function show_plot() {
if (ttick < t0_ticks) { ttick += tickint; }

tst = '<g id="times">\n';
while (ttick <= tf_ticks) {
while (ttick <= tf_ticks + 0.1) {
xtick = Math.round((ttick - t0_ticks)*tscl/tickfreq);
tst += '<text x="' + xtick + '" y="' + svgts + '" font-size="' + svgtf
+ '" fill="red" style="text-anchor: middle;">'
Expand Down

0 comments on commit cfd2875

Please sign in to comment.