Корретная отрисовка в Canvas

This commit is contained in:
2025-12-07 20:49:47 +03:00
parent 0cb599e0e4
commit c9d3a73255
4 changed files with 64 additions and 21 deletions

View File

@@ -250,6 +250,10 @@ public:
void clearByTag(int tagId, bool is_fixed_point = false);
int addConstraint(Constraint* constr);
void removeConstraint(Constraint* constr);
std::vector<Constraint*> get_clist(){
return clist;
}
Constraint* get_last_constraint() {
return clist[clist.size() - 1];
}

View File

@@ -218,17 +218,6 @@ Line* Line::Copy()
return crv;
}
void Line::draw(QPainter& p, bool highlight){
QPen pen = highlight ? QPen(Qt::red, 4) : QPen(Qt::black, 2);
p.setPen(pen);
p.drawLine(QPointF(p1.get_X(), p1.get_Y()), QPointF(p2.get_X(), p2.get_Y()));
p.setBrush(highlight ? Qt::red : Qt::blue);
p.drawEllipse(QPointF(p1.get_X(), p1.get_Y()), 4, 4);
p.drawEllipse(QPointF(p2.get_X(), p2.get_Y()), 4, 4);
}
//---------------circle
DeriVector2 Circle::CalculateNormal(const Point& p, const double* derivparam) const

View File

@@ -226,7 +226,6 @@ public:
void ReconstructOnNewPvec(VEC_pD& pvec, int& cnt) override;
Line* Copy() override;
void draw(QPainter& p, bool highlight = false);
void set_tag(int);
bool contains(QPointF, qreal tol = 10.0) const;
};