+ // set GridOffset
+ if (PlotGridX <= 0) return;
+ int offset = GridOffset;
+ if (GridLocked && PlotGridX) {
+ offset = GridOffset + PlotGridX - (GraphStart % PlotGridX);
+ } else if (!GridLocked && GraphStart > 0 && PlotGridX) {
+ offset = PlotGridX-((GraphStart - offset) % PlotGridX) + GraphStart - unlockStart;
+ }
+ offset %= PlotGridX;
+ if (offset < 0) offset += PlotGridX;
+