summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorZhang Sheng <zhangsheng@uniontech.com>2020-11-16 11:19:17 +0800
committerZhang Sheng <zhangsheng@uniontech.com>2020-11-16 12:53:37 +0000
commite13173c112b729da8f53dd2e81e8116a1ed857cf (patch)
tree49c2bce0c3349eebd0f2b62c80a1b7168ae45dc2 /src/gui/painting
parent802e5a45baf3ac7da2cb3be06d10bdd69696fcae (diff)
Adjust code format, add space after 'if'
Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qbezier.cpp2
-rw-r--r--src/gui/painting/qblendfunctions.cpp6
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp2
-rw-r--r--src/gui/painting/qpainter.cpp2
-rw-r--r--src/gui/painting/qpainterpath.cpp2
-rw-r--r--src/gui/painting/qpathclipper.cpp2
-rw-r--r--src/gui/painting/qpdf.cpp10
-rw-r--r--src/gui/painting/qtransform.cpp2
8 files changed, 14 insertions, 14 deletions
diff --git a/src/gui/painting/qbezier.cpp b/src/gui/painting/qbezier.cpp
index 8b1097ac5b..dabf1b0d23 100644
--- a/src/gui/painting/qbezier.cpp
+++ b/src/gui/painting/qbezier.cpp
@@ -473,7 +473,7 @@ void QBezier::addIfClose(qreal *length, qreal error) const
chord = QLineF(QPointF(x1, y1),QPointF(x4, y4)).length();
- if((len-chord) > error) {
+ if ((len-chord) > error) {
const auto halves = split(); /* split in two */
halves.first.addIfClose(length, error); /* try left side */
halves.second.addIfClose(length, error); /* try right side */
diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp
index 348eceb47f..519601a11d 100644
--- a/src/gui/painting/qblendfunctions.cpp
+++ b/src/gui/painting/qblendfunctions.cpp
@@ -96,7 +96,7 @@ struct Blend_ARGB32_on_RGB16_SourceAlpha {
const quint8 alpha = qAlpha(src);
if (alpha) {
quint16 s = qConvertRgb32To16(src);
- if(alpha < 255)
+ if (alpha < 255)
s += BYTE_MUL_RGB16(*dst, 255 - alpha);
*dst = s;
}
@@ -113,9 +113,9 @@ struct Blend_ARGB32_on_RGB16_SourceAndConstAlpha {
inline void write(quint16 *dst, quint32 src) {
src = BYTE_MUL(src, m_alpha);
const quint8 alpha = qAlpha(src);
- if(alpha) {
+ if (alpha) {
quint16 s = qConvertRgb32To16(src);
- if(alpha < 255)
+ if (alpha < 255)
s += BYTE_MUL_RGB16(*dst, 255 - alpha);
*dst = s;
}
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 44d63d72b8..ca1c4f831e 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -708,7 +708,7 @@ void QRasterPaintEngine::updatePen(const QPen &pen)
else
d->basicStroker.setStrokeWidth(penWidth);
- if(pen_style == Qt::SolidLine) {
+ if (pen_style == Qt::SolidLine) {
s->stroker = &d->basicStroker;
} else if (pen_style != Qt::NoPen) {
if (!d->dashStroker)
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 8326b10083..6bc440b5b3 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -7269,7 +7269,7 @@ start_lengthVariant:
qreal lineWidth = 0x01000000;
if (wordwrap || (tf & Qt::TextJustificationForced))
lineWidth = qMax<qreal>(0, r.width());
- if(!wordwrap)
+ if (!wordwrap)
tf |= Qt::TextIncludeTrailingSpaces;
textLayout.beginLayout();
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 09021c119c..797d456ce4 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -3295,7 +3295,7 @@ QPainterPath QPainterPath::subtracted(const QPainterPath &p) const
*/
QPainterPath QPainterPath::simplified() const
{
- if(isEmpty())
+ if (isEmpty())
return *this;
QPathClipper clipper(*this, QPainterPath());
return clipper.clip(QPathClipper::Simplify);
diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp
index f2a45025f6..b3521f41ac 100644
--- a/src/gui/painting/qpathclipper.cpp
+++ b/src/gui/painting/qpathclipper.cpp
@@ -1965,7 +1965,7 @@ void clipLine(const QPointF &a, const QPointF &b, qreal t, QPainterPath &result)
if (outA)
addLine(result, QLineF(intersectLine<edge>(a, b, t), b));
- else if(outB)
+ else if (outB)
addLine(result, QLineF(a, intersectLine<edge>(a, b, t)));
else
addLine(result, QLineF(a, b));
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 626274d856..55a1aa0242 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -858,12 +858,12 @@ void QPdfEngine::drawRects (const QRectF *rects, int rectCount)
if (d->simplePen || !d->hasPen) {
// draw strokes natively in this case for better output
- if(!d->simplePen && !d->stroker.matrix.isIdentity())
+ if (!d->simplePen && !d->stroker.matrix.isIdentity())
*d->currentPage << "q\n" << QPdf::generateMatrix(d->stroker.matrix);
for (int i = 0; i < rectCount; ++i)
*d->currentPage << rects[i].x() << rects[i].y() << rects[i].width() << rects[i].height() << "re\n";
*d->currentPage << (d->hasPen ? (d->hasBrush ? "B\n" : "S\n") : "f\n");
- if(!d->simplePen && !d->stroker.matrix.isIdentity())
+ if (!d->simplePen && !d->stroker.matrix.isIdentity())
*d->currentPage << "Q\n";
} else {
QPainterPath p;
@@ -1056,7 +1056,7 @@ void QPdfEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
}
*d->currentPage << "q\n";
- if(!d->simplePen)
+ if (!d->simplePen)
*d->currentPage << QPdf::generateMatrix(d->stroker.matrix);
bool hp = d->hasPen;
@@ -2304,7 +2304,7 @@ int QPdfEnginePrivate::writeCompressed(QIODevice *dev)
int QPdfEnginePrivate::writeCompressed(const char *src, int len)
{
#ifndef QT_NO_COMPRESS
- if(do_compress) {
+ if (do_compress) {
uLongf destLen = len + len/100 + 13; // zlib requirement
Bytef* dest = new Bytef[destLen];
if (Z_OK == ::compress(dest, &destLen, (const Bytef*) src, (uLongf)len)) {
@@ -2833,7 +2833,7 @@ int QPdfEnginePrivate::addImage(const QImage &img, bool *bitmap, bool lossless,
return -1;
int object = imageCache.value(serial_no);
- if(object)
+ if (object)
return object;
QImage image = img;
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 34dd425fef..8f2dc21a21 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -2033,7 +2033,7 @@ void QTransform::map(int x, int y, int *tx, int *ty) const
*/
QTransform::TransformationType QTransform::type() const
{
- if(m_dirty == TxNone || m_dirty < m_type)
+ if (m_dirty == TxNone || m_dirty < m_type)
return static_cast<TransformationType>(m_type);
switch (static_cast<TransformationType>(m_dirty)) {