Re: I want to help
Posted by
dxli on
Jan 25, 2014; 3:08am
URL: https://forum.librecad.org/I-want-to-help-tp5709375p5709415.html
Yes, I see how this bug happens.
However, the inconsistence is a bug to me.
We can make the generated polyline valid in the fake "closed" polyline case.
rs_modification.cpp, line 2883
bool insertAfter1 = false;
if (!isClosedPolyline) {
insertAfter1 = (idx1<idx2);
}
else {
insertAfter1 = ((idx1<idx2 && idx1!=0) ||(idx1==0 && idx2==1) ||
(idx2==0 && idx1==(int)baseContainer->count()-1));
}
// insert rounding at the right position:
//if ((idx1<idx2 && idx1!=0) ||
// (idx2==0 && idx1==(int)baseContainer->count()-1)) {
//if (idx1<idx2) {
if (insertAfter1) {
if (trimmed1->getEndpoint().distanceTo(arc->getStartpoint())>1.0e-4) {
arc->reverse();
}
baseContainer->insertEntity(idx1+1, arc);
} else {
if (trimmed2->getEndpoint().distanceTo(arc->getStartpoint())>1.0e-4) {
arc->reverse();
}
baseContainer->insertEntity(idx2+1, arc);
}