Skip to content

Commit 227efc7

Browse files
authored
1 parent efb9516 commit 227efc7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

graf2d/gpad/src/TPad.cxx

+5-3
Original file line numberDiff line numberDiff line change
@@ -4178,7 +4178,7 @@ void TPad::PaintHatches(Double_t dy, Double_t angle,
41784178
Int_t nn, Double_t *xx, Double_t *yy)
41794179
{
41804180
Int_t i, i1, i2, nbi, m, inv;
4181-
Double_t ratiox, ratioy, ymin, ymax, yrot, ycur;
4181+
Double_t ratiox, ratioy, ymin, ymax, yrot;
41824182
const Double_t angr = TMath::Pi()*(180.-angle)/180.;
41834183
const Double_t epsil = 0.0001;
41844184
const Int_t maxnbi = 100;
@@ -4220,8 +4220,10 @@ void TPad::PaintHatches(Double_t dy, Double_t angle,
42204220
if (yrot < ymin) ymin = yrot;
42214221
}
42224222
ymax = (Double_t)((Int_t)(ymax/dy))*dy;
4223-
4224-
for (ycur=ymax; ycur>=ymin; ycur=ycur-dy) {
4223+
4224+
const Int_t nYsteps = static_cast<Int_t>((ymax - ymin)/dy) + 1;
4225+
for (Int_t icur = 0; icur < nYsteps; ++icur) {
4226+
const Double_t ycur = ymax - icur * dy;
42254227
nbi = 0;
42264228
for (i=2; i<=nn+1; i++) {
42274229
i2 = i;

0 commit comments

Comments
 (0)