Skip to content

Commit 85088ff

Browse files
committed
[gaxis] do not paint first and last tick twice
If position of first or last tick does not match exactly visible axis range, extra first and extra last tick was painted. While such matching can suffer from float arithmetic uncertanty, on some platforms extra ticks was painted and on others not. This was actually main reason for light variation of PS file size on different platforms. Now simply do not paint first and last tick again in no case.
1 parent e011074 commit 85088ff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graf2d/graf/src/TGaxis.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,8 @@ void TGaxis::PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t yma
17321732
if ((!optionNoopt || optionInt) && axis_length0) {
17331733
nticks0 = Int_t(axis_length0/dxtick);
17341734
if (nticks0 > 1000) nticks0 = 1000;
1735-
for (k=0; k<=nticks0; k++) {
1735+
xtick0 -= dxtick; // skip first major tick which already was drawn
1736+
for (k=1; k<=nticks0; k++) {
17361737
ltick = 2;
17371738
if (k%nn3 == 0) ltick = 1;
17381739
if (k%nn2 == 0) ltick = 0;
@@ -1776,7 +1777,8 @@ void TGaxis::PaintAxis(Double_t xmin, Double_t ymin, Double_t xmax, Double_t yma
17761777
if ((!optionNoopt || optionInt) && axis_length1) {
17771778
nticks1 = int(axis_length1/dxtick);
17781779
if (nticks1 > 1000) nticks1 = 1000;
1779-
for (k=0; k<=nticks1; k++) {
1780+
xtick1 += dxtick; // skip last major tick which was already drawn
1781+
for (k=1; k<=nticks1; k++) {
17801782
ltick = 2;
17811783
if (k%nn3 == 0) ltick = 1;
17821784
if (k%nn2 == 0) ltick = 0;

0 commit comments

Comments
 (0)