File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -647,15 +647,20 @@ std::cerr << i << ": " << ring->first[i]
647
647
ringDetails.push_back (std::make_pair (ii, ringSize));
648
648
649
649
// Transfer points to the array of QPointF
650
- for (register unsigned int j = 0 ; j != ringSize; ++j, ++ii)
650
+ // for (register unsigned int j = 0; j != ringSize; ++j, ++ii)
651
+ for (register unsigned int j = 0 ; j != ringSize; ++j, ii++)
651
652
{
652
653
// there is maybe a bug in Qt4.1: when using doubles without rounding,
653
654
// I've experienced crashes (broken pipe) when drawing polygon
654
655
// with more than 3000 vertices [MD]
655
- pa[ii].setX (static_cast <int >(r->first [j] + 0.5 ));
656
- pa[ii].setY (static_cast <int >(r->second [j] + 0.5 ));
657
- // pa[ii].setX(r->first[j]);
658
- // pa[ii].setY(r->second[j]);
656
+ // pa[ii].setX(static_cast<int>(r->first[j] + 0.5));
657
+ // pa[ii].setY(static_cast<int>(r->second[j] + 0.5));
658
+
659
+ // The crash was probably caused by writing outside
660
+ // pa(total_points + numRings - 1) size, because
661
+ // cycle was using ++ii insted of ii++ => reenabled floating point
662
+ pa[ii].setX (r->first [j]);
663
+ pa[ii].setY (r->second [j]);
659
664
}
660
665
661
666
// Store the last point of the first ring, and insert it at
You can’t perform that action at this time.
0 commit comments