From 54efbc22fc9cfe709fa58fb191ec35ff5a81012b Mon Sep 17 00:00:00 2001 From: Oleg Korshul Date: Sun, 3 Dec 2023 22:04:47 +0300 Subject: [PATCH] Fix indents --- DesktopEditor/graphics/GraphicsLayer.h | 9 +++-- DesktopEditor/graphics/pro/graphics.pro | 40 +++++++++---------- .../graphics/tests/graphicsLayers/main.cpp | 6 ++- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/DesktopEditor/graphics/GraphicsLayer.h b/DesktopEditor/graphics/GraphicsLayer.h index c6dd6cad45..e26838018a 100644 --- a/DesktopEditor/graphics/GraphicsLayer.h +++ b/DesktopEditor/graphics/GraphicsLayer.h @@ -42,13 +42,16 @@ namespace Aggplus value_type* pDstBuffer = NULL; BYTE uchAlpha; - for (unsigned int unY = 0; unY < oSrc.height(); ++unY) + unsigned int unSrcW = oSrc.width(); + unsigned int unSrcH = oSrc.height(); + + for (unsigned int unY = 0; unY < unSrcH; ++unY) { pDstBuffer = oSrc.row_ptr(unY); - for (unsigned int unX = 0; unX < oSrc.width(); ++unX) + for (unsigned int unX = 0; unX < unSrcW; ++unX) { uchAlpha = (pSrcBuffer[order_type::A] * ((value_type)(m_oSettings.m_dOpacity * 255.)) + 1) >> 8; - if(uchAlpha) + if (uchAlpha) { if(uchAlpha == SrcPixelFormatRenderer::base_mask) { diff --git a/DesktopEditor/graphics/pro/graphics.pro b/DesktopEditor/graphics/pro/graphics.pro index 04483815a7..096c52db19 100644 --- a/DesktopEditor/graphics/pro/graphics.pro +++ b/DesktopEditor/graphics/pro/graphics.pro @@ -1,4 +1,4 @@ -QT -= core gui +QT -= core gui TARGET = graphics TEMPLATE = lib @@ -7,12 +7,12 @@ CONFIG += graphics_dynamic_library DEFINES += _QT graphics_dynamic_library { - CONFIG += shared + CONFIG += shared CONFIG += plugin - DEFINES += GRAPHICS_USE_DYNAMIC_LIBRARY_BUILDING + DEFINES += GRAPHICS_USE_DYNAMIC_LIBRARY_BUILDING } else { - DEFINES += GRAPHICS_NO_USE_DYNAMIC_LIBRARY + DEFINES += GRAPHICS_NO_USE_DYNAMIC_LIBRARY CONFIG += static } @@ -23,7 +23,7 @@ include(../../../Common/base.pri) ADD_DEPENDENCY(UnicodeConverter, kernel) core_windows { - LIBS += -lAdvapi32 + LIBS += -lAdvapi32 LIBS += -lShell32 } @@ -32,35 +32,35 @@ HEADERS += ./../config.h GRAPHICS_AGG_PATH = $$PWD/../../agg-2.4 INCLUDEPATH += \ - $$GRAPHICS_AGG_PATH/include + $$GRAPHICS_AGG_PATH/include # matrix HEADERS += \ - $$GRAPHICS_AGG_PATH/include/test_grads/custom_gradients.h \ - ./../Matrix_private.h \ + $$GRAPHICS_AGG_PATH/include/test_grads/custom_gradients.h \ + ./../Matrix_private.h \ ./../Matrix.h SOURCES += \ - ./../Matrix.cpp + ./../Matrix.cpp SOURCES += \ - $$GRAPHICS_AGG_PATH/src/agg_trans_affine.cpp + $$GRAPHICS_AGG_PATH/src/agg_trans_affine.cpp # paths HEADERS += \ - ./../GraphicsPath_private.h \ + ./../GraphicsPath_private.h \ ./../GraphicsPath.h SOURCES += \ - ./../GraphicsPath.cpp + ./../GraphicsPath.cpp # alpha mask HEADERS += \ - ./../AlphaMask_private.h \ + ./../AlphaMask_private.h \ ./../AlphaMask.h SOURCES += \ - ./../AlphaMask_private.cpp \ + ./../AlphaMask_private.cpp \ ./../AlphaMask.cpp # grapgics layer @@ -71,7 +71,7 @@ SOURCES += \ ./../GraphicsLayer.cpp SOURCES += \ - $$GRAPHICS_AGG_PATH/src/agg_arc.cpp \ + $$GRAPHICS_AGG_PATH/src/agg_arc.cpp \ $$GRAPHICS_AGG_PATH/src/agg_bezier_arc.cpp \ $$GRAPHICS_AGG_PATH/src/agg_curves.cpp \ $$GRAPHICS_AGG_PATH/src/agg_bspline.cpp \ @@ -83,9 +83,9 @@ include(raster.pri) #CONFIG += graphics_disable_metafile graphics_disable_metafile { - DEFINES += GRAPHICS_DISABLE_METAFILE + DEFINES += GRAPHICS_DISABLE_METAFILE } else { - include(metafile.pri) + include(metafile.pri) } CONFIG += support_font_converter @@ -97,7 +97,7 @@ SOURCES += ./officedrawingfile.cpp # graphics SOURCES += \ - $$GRAPHICS_AGG_PATH/src/agg_arrowhead.cpp \ + $$GRAPHICS_AGG_PATH/src/agg_arrowhead.cpp \ $$GRAPHICS_AGG_PATH/src/agg_image_filters.cpp \ $$GRAPHICS_AGG_PATH/src/agg_line_aa_basics.cpp \ $$GRAPHICS_AGG_PATH/src/agg_line_profile_aa.cpp \ @@ -106,7 +106,7 @@ SOURCES += \ $$GRAPHICS_AGG_PATH/src/agg_vcgen_smooth_poly1.cpp HEADERS += \ - ./../ArrowHead.h \ + ./../ArrowHead.h \ ./../Brush.h \ ./../Clip.h \ ./../Color.h \ @@ -122,7 +122,7 @@ HEADERS += \ ./Image.h SOURCES += \ - ./../ArrowHead.cpp \ + ./../ArrowHead.cpp \ ./../Brush.cpp \ ./../Clip.cpp \ ./../Graphics.cpp \ diff --git a/DesktopEditor/graphics/tests/graphicsLayers/main.cpp b/DesktopEditor/graphics/tests/graphicsLayers/main.cpp index 9be43dc456..34d875eae6 100644 --- a/DesktopEditor/graphics/tests/graphicsLayers/main.cpp +++ b/DesktopEditor/graphics/tests/graphicsLayers/main.cpp @@ -51,10 +51,11 @@ int main(int argc, char *argv[]) pRasterRenderer->EndCommand(c_nPathType); // Отрисовываем второй слой + pRasterRenderer->BeginCommand(c_nLayerType); + pRasterRenderer->BeginCommand(c_nPathType); pRasterRenderer->PathCommandStart(); - pRasterRenderer->BeginCommand(c_nLayerType); pRasterRenderer->PathCommandRect(300, 300, 300, 300); pRasterRenderer->put_BrushAlpha1(255); @@ -72,10 +73,11 @@ int main(int argc, char *argv[]) pRasterRenderer->EndCommand(c_nPathType); //Отрисовываем третий слой + pRasterRenderer->BeginCommand(c_nLayerType); + pRasterRenderer->BeginCommand(c_nPathType); pRasterRenderer->PathCommandStart(); - pRasterRenderer->BeginCommand(c_nLayerType); pRasterRenderer->PathCommandRect(500, 400, 300, 300); pRasterRenderer->put_BrushAlpha1(150);