summaryrefslogtreecommitdiffstats
path: root/src/widgets/effects/qpixmapfilter.cpp
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/widgets/effects/qpixmapfilter.cpp
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/widgets/effects/qpixmapfilter.cpp')
-rw-r--r--src/widgets/effects/qpixmapfilter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/widgets/effects/qpixmapfilter.cpp b/src/widgets/effects/qpixmapfilter.cpp
index 2c8900327e..c23cfd7e44 100644
--- a/src/widgets/effects/qpixmapfilter.cpp
+++ b/src/widgets/effects/qpixmapfilter.cpp
@@ -353,17 +353,17 @@ static void convolute(
int kernely = -kernelHeight/2;
int starty = 0;
int endy = kernelHeight;
- if(yk+kernely+endy >= srcImage.height())
+ if (yk+kernely+endy >= srcImage.height())
endy = kernelHeight-((yk+kernely+endy)-srcImage.height())-1;
- if(yk+kernely < 0)
+ if (yk+kernely < 0)
starty = -(yk+kernely);
int kernelx = -kernelWidth/2;
int startx = 0;
int endx = kernelWidth;
- if(xk+kernelx+endx >= srcImage.width())
+ if (xk+kernelx+endx >= srcImage.width())
endx = kernelWidth-((xk+kernelx+endx)-srcImage.width())-1;
- if(xk+kernelx < 0)
+ if (xk+kernelx < 0)
startx = -(xk+kernelx);
for (int ys = starty; ys < endy; ys ++) {
@@ -385,7 +385,7 @@ static void convolute(
b = qBound((int)0, b >> 16, (int)255);
a = qBound((int)0, a >> 16, (int)255);
// composition mode checking could be moved outside of loop
- if(mode == QPainter::CompositionMode_Source) {
+ if (mode == QPainter::CompositionMode_Source) {
uint color = (a<<24)+(r<<16)+(g<<8)+b;
*output++ = color;
} else {
@@ -416,7 +416,7 @@ void QPixmapConvolutionFilter::draw(QPainter *painter, const QPointF &p, const Q
if (!painter->isActive())
return;
- if(d->kernelWidth<=0 || d->kernelHeight <= 0)
+ if (d->kernelWidth<=0 || d->kernelHeight <= 0)
return;
if (src.isNull())