Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Office
Calligra
Commits
b044df22
Commit
b044df22
authored
Apr 06, 2012
by
Halla Rempt
Browse files
Let Qt draw the polyline
We used to draw lines ourselves, giving a bad result. CCBUG:297595
parent
b9a260cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
krita/ui/widgets/kis_curve_widget.cpp
View file @
b044df22
...
...
@@ -269,12 +269,12 @@ void KisCurveWidget::paintEvent(QPaintEvent *)
p
.
setRenderHint
(
QPainter
::
Antialiasing
);
// Draw curve.
double
prevY
=
wHeight
-
d
->
m_curve
.
value
(
0.
)
*
wHeight
;
double
prevX
=
0.
;
double
curY
;
double
normalizedX
;
int
x
;
QPolygonF
poly
;
p
.
setPen
(
QPen
(
Qt
::
black
,
1
,
Qt
::
SolidLine
));
for
(
x
=
0
;
x
<
wWidth
;
x
++
)
{
normalizedX
=
double
(
x
)
/
wWidth
;
...
...
@@ -285,13 +285,10 @@ void KisCurveWidget::paintEvent(QPaintEvent *)
* to ints mathematically, not just rounds down
* like in C
*/
p
.
drawLine
(
QLineF
(
prevX
,
prevY
,
x
,
curY
));
prevX
=
x
;
prevY
=
curY
;
poly
.
append
(
QPointF
(
x
,
curY
));
}
p
.
drawLine
(
QL
in
e
F
(
prevX
,
prevY
,
x
,
wHeight
-
d
->
m_curve
.
value
(
1.0
)
*
wHeight
)
);
p
oly
.
append
(
QPo
in
t
F
(
x
,
wHeight
-
d
->
m_curve
.
value
(
1.0
)
*
wHeight
));
p
.
drawPolyline
(
poly
);
// Drawing curve handles.
double
curveX
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment