Summary: | Ellipse object does not correctly limit border width | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Andrew Walker <arwalker> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Proposed patch |
Description
Andrew Walker
2007-04-03 20:37:41 UTC
Created attachment 20192 [details]
Proposed patch
SVN commit 653120 by arwalker: BUG:143805 Limit the border width of an ellipse so it doesn't extend beyond its own edge M +10 -3 kstviewellipse.cpp --- branches/work/kst/1.5/kst/src/libkstapp/kstviewellipse.cpp #653119:653120 @@ -95,15 +95,22 @@ } } - const int bw(_borderWidth * p.lineWidthAdjustmentFactor()); + const QRect g(geometry()); + int bw(_borderWidth * p.lineWidthAdjustmentFactor()); + if (bw > g.width()/2) { + bw = g.width()/2; + } + if (bw > g.height()/2) { + bw = g.height()/2; + } QPen pen(bw > 0 ? _borderColor : _foregroundColor, bw); p.setPen(pen); if (_transparentFill) { - p.setBrush(Qt::NoBrush); + p.setBrush(Qt::NoBrush); } else { p.setBrush(_foregroundColor); } - const QRect g(geometry()); + p.drawEllipse(g.x() + bw/2, g.y() + bw/2, g.width() - bw, g.height() - bw); p.restore(); } |