Skip to content

timecode wrong when drawdirection == horizontal #6

Open
@rosspleban

Description

@rosspleban

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions