Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

timecode wrong when drawdirection == horizontal #6

Open
rosspleban opened this issue Jul 12, 2021 · 0 comments
Open

timecode wrong when drawdirection == horizontal #6

rosspleban opened this issue Jul 12, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@rosspleban
Copy link

The timecode message is wrong when using a 2D layer in the horizontal drawing mode. Possible fix below

diff --git a/js/sigplot.js b/js/sigplot.js
index 75fe004..1f7eda5 100644
--- a/js/sigplot.js
+++ b/js/sigplot.js
@@ -4486,7 +4486,14 @@
                 if ((hcb["class"] === 1) && ((hcb.xunits === 1) || (hcb.xunits === 4))) {
                     mx.message(Mx, "Time = " + m.sec2tod(hcb.timecode + Gx.retx), true);
                 } else if ((hcb["class"] === 2) && ((hcb.yunits === 1) || (hcb.yunits === 4))) {
-                    mx.message(Mx, "Time = " + m.sec2tod(hcb.timecode + Gx.rety), true);
+                    var drawdirection = Gx.lyr[0].drawdirection;
+                    var retval;
+                    if (drawdirection && drawdirection === "horizontal") {
+                        retval = Gx.retx;
+                    } else {
+                        retval = Gx.rety;
+                    }
+                    mx.message(Mx, "Time = " + m.sec2tod(hcb.timecode + retval), true);

@mrecachinas mrecachinas added the bug Something isn't working label Oct 14, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants