Correction : bug graphique lors de l'utilisation d'embouts sur les lignes horizontales ou verticales.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@705 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2009-06-20 01:09:10 +00:00
parent fb447a7752
commit 40ec0cf39e

View File

@@ -450,17 +450,20 @@ void PartLine::debugPaint(QPainter *painter) {
QRectF PartLine::boundingRect() const { QRectF PartLine::boundingRect() const {
QRectF r(QGraphicsLineItem::boundingRect()); QRectF r(QGraphicsLineItem::boundingRect());
// cas special : le cercle sort largement du bounding rect originel // le rectangle ainsi obtenu ne doit pas avoir une dimension nulle
if (first_end == QET::Circle) { r.adjust(0.0, 0.0, 0.1, 0.1);
// cas special : les embouts sortent largement du bounding rect originel
if (first_end != QET::None) {
r = r.united(firstEndCircleRect()); r = r.united(firstEndCircleRect());
} }
if (second_end == QET::Circle) { if (second_end != QET::None) {
r = r.united(secondEndCircleRect()); r = r.united(secondEndCircleRect());
} }
// la taille du bounding rect est ajustee de 0.2px // la taille du bounding rect est ajustee avec une certaine marge
qreal adjust = 0.6; qreal adjust = 1.2;
r.adjust(-adjust, -adjust, adjust, adjust); r.adjust(-adjust, -adjust, adjust, adjust);
return(r); return(r);
} }