Skip to content

Commit 7ca45b6

Browse files
committed
[hist3d] avoid paint of extremly small segments
On some platforms FindVisibleDraw returns different result for same data. Either line is not visible at all or extremly small segment from the line is visible. In last case do not call paint for gPad Has effect on 3D axis grid painter and lego painter for several stressGraphics tests - but only when checking PS/SVG/PDF content, size reduction is very small
1 parent e5a6879 commit 7ca45b6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

hist/histpainter/src/TPainter3dAlgorithms.cxx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class by Rene Brun.
4343
const Double_t kRad = TMath::ATan(1)*Double_t(4)/Double_t(180);
4444
const Double_t kFdel = 0.;
4545
const Double_t kDel = 0.0001;
46+
const Double_t kEps = 1e-9; // exclude such small segments
4647
const Int_t kNiso = 4;
4748
const Int_t kNmaxp = kNiso*13;
4849
const Int_t kNmaxt = kNiso*12;
@@ -593,7 +594,8 @@ void TPainter3dAlgorithms::DrawFaceMove1(Int_t *icodes, Double_t *xyz, Int_t np,
593594
y[0] = p1[1] + ydel*fT[2*it + 0];
594595
x[1] = p1[0] + xdel*fT[2*it + 1];
595596
y[1] = p1[1] + ydel*fT[2*it + 1];
596-
gPad->PaintPolyLine(2, x, y);
597+
if (TMath::Abs(fT[2*it + 0] - fT[2*it + 1]) > kEps)
598+
gPad->PaintPolyLine(2, x, y);
597599
}
598600
}
599601

@@ -621,7 +623,8 @@ void TPainter3dAlgorithms::DrawFaceMove1(Int_t *icodes, Double_t *xyz, Int_t np,
621623
y[0] = p1[1] + ydel*fT[2*it + 0];
622624
x[1] = p1[0] + xdel*fT[2*it + 1];
623625
y[1] = p1[1] + ydel*fT[2*it + 1];
624-
gPad->PaintPolyLine(2, x, y);
626+
if (TMath::Abs(fT[2*it + 0] - fT[2*it + 1]) > kEps)
627+
gPad->PaintPolyLine(2, x, y);
625628
}
626629
}
627630

@@ -681,7 +684,8 @@ void TPainter3dAlgorithms::DrawFaceMove2(Int_t *icodes, Double_t *xyz, Int_t np,
681684
y[0] = p1[1] + ydel*fT[2*it + 0];
682685
x[1] = p1[0] + xdel*fT[2*it + 1];
683686
y[1] = p1[1] + ydel*fT[2*it + 1];
684-
gPad->PaintPolyLine(2, x, y);
687+
if (TMath::Abs(fT[2*it + 0] - fT[2*it + 1]) > kEps)
688+
gPad->PaintPolyLine(2, x, y);
685689
}
686690
}
687691

@@ -763,7 +767,8 @@ void TPainter3dAlgorithms::DrawFaceMove3(Int_t *icodes, Double_t *xyz, Int_t np,
763767
y[0] = p1[1] + ydel*fT[2*it + 0];
764768
x[1] = p1[0] + xdel*fT[2*it + 1];
765769
y[1] = p1[1] + ydel*fT[2*it + 1];
766-
gPad->PaintPolyLine(2, x, y);
770+
if (TMath::Abs(fT[2*it + 0] - fT[2*it + 1]) > kEps)
771+
gPad->PaintPolyLine(2, x, y);
767772
}
768773
}
769774
}

0 commit comments

Comments
 (0)