Skip to content

Commit aaf68e0

Browse files
committed
fix: implementation of absc mode for pipe layers that don't update Gx.xstart/Gx.xdelta as part of basefile
1 parent 3be45a6 commit aaf68e0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

js/sigplot.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8606,11 +8606,19 @@
86068606
Gx.iabsc = 2;
86078607
} // R/I mode
86088608
if (Gx.iabsc === 1) { // index
8609-
Gx.aretx = Math.round((Gx.aretx - Gx.xstart) / Gx.xdelta);
8609+
// if there is more than one layer index is ambiguous, so use the first layer only
8610+
var hcb = plot.get_hcb_by_lyrn(0);
8611+
if (hcb) {
8612+
Gx.aretx = Math.round((Gx.aretx - hcb.xstart) / hcb.xdelta);
8613+
Gx.dretx = Math.round(Gx.dretx / hcb.xdelta);
8614+
} else {
8615+
Gx.aretx = 0;
8616+
Gx.dretx = 1;
8617+
}
86108618
if (!Gx.index) {
86118619
Gx.aretx += 1;
86128620
}
8613-
Gx.dretx = Math.round(Gx.dretx / Gx.xdelta);
8621+
86148622
} else if (Gx.iabsc === 2) { // 1/absc
86158623
if (Gx.aretx !== 0.0) {
86168624
Gx.aretx = 1.0 / Gx.aretx;

0 commit comments

Comments
 (0)