Uncrustified Files

This commit is contained in:
2020-01-13 19:59:30 +01:00
parent 048fae53fb
commit 6fec7c26bf
10 changed files with 449 additions and 449 deletions

View File

@@ -46,7 +46,7 @@ void IntelliPhotoGui::slotOpen(){
// If we have a file name load the image and place // If we have a file name load the image and place
// it in the paintingArea // it in the paintingArea
if (!fileName.isEmpty()){ if (!fileName.isEmpty()) {
paintingArea->open(fileName); paintingArea->open(fileName);
UpdateGui(); UpdateGui();
} }
@@ -84,7 +84,7 @@ void IntelliPhotoGui::slotCreateNewLayer(){
tr("Height:"), tr("Height:"),
200,1, 500, 1, &ok2); 200,1, 500, 1, &ok2);
// Create New Layer // Create New Layer
if (ok1&&ok2){ if (ok1&&ok2) {
paintingArea->addLayer(width,height,0,0); paintingArea->addLayer(width,height,0,0);
UpdateGui(); UpdateGui();
} }
@@ -676,7 +676,7 @@ void IntelliPhotoGui::createGui(){
ActiveLayerLine->setFixedSize(Buttonsize.width()+10,Buttonsize.height()/3); ActiveLayerLine->setFixedSize(Buttonsize.width()+10,Buttonsize.height()/3);
IntelliImage* activePicture = paintingArea->getImageOfActiveLayer(); IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
if(activePicture){ if(activePicture) {
preview = preview.fromImage(activePicture->getImageData()); preview = preview.fromImage(activePicture->getImageData());
}else{ }else{
QImage tmp(1,1,QImage::Format_ARGB32); QImage tmp(1,1,QImage::Format_ARGB32);
@@ -804,7 +804,7 @@ void IntelliPhotoGui::UpdateGui(){
ActiveLayerLine->setText(string); ActiveLayerLine->setText(string);
IntelliImage* activePicture = paintingArea->getImageOfActiveLayer(); IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
if(activePicture){ if(activePicture) {
preview = preview.fromImage(activePicture->getImageData()); preview = preview.fromImage(activePicture->getImageData());
}else{ }else{
QImage tmp(1,1,QImage::Format_ARGB32); QImage tmp(1,1,QImage::Format_ARGB32);

View File

@@ -4,11 +4,11 @@
IntelliImage::IntelliImage(int width, int height, bool fastRendererOn) IntelliImage::IntelliImage(int width, int height, bool fastRendererOn)
: imageData(QSize(width, height), fastRendererOn ? QImage::Format_Indexed8 : QImage::Format_ARGB32){ : imageData(QSize(width, height), fastRendererOn ? QImage::Format_Indexed8 : QImage::Format_ARGB32){
if(fastRendererOn){ if(fastRendererOn) {
imageData = imageData.convertToFormat(QImage::Format_ARGB32); imageData = imageData.convertToFormat(QImage::Format_ARGB32);
} }
imageData.fill(QColor(255,255,255,255)); imageData.fill(QColor(255,255,255,255));
if(fastRendererOn){ if(fastRendererOn) {
imageData = imageData.convertToFormat(QImage::Format_Indexed8); imageData = imageData.convertToFormat(QImage::Format_Indexed8);
} }
this->fastRenderering = fastRendererOn; this->fastRenderering = fastRendererOn;
@@ -46,7 +46,7 @@ void IntelliImage::resizeImage(QImage*image, const QSize &newSize){
// Draw the image // Draw the image
QPainter painter(&newImage); QPainter painter(&newImage);
painter.drawImage(QPoint(0, 0), *image); painter.drawImage(QPoint(0, 0), *image);
if(fastRenderering){ if(fastRenderering) {
*image = newImage.convertToFormat(QImage::Format_Indexed8); *image = newImage.convertToFormat(QImage::Format_Indexed8);
} }
else{ else{
@@ -55,7 +55,7 @@ void IntelliImage::resizeImage(QImage*image, const QSize &newSize){
} }
void IntelliImage::drawPixel(const QPoint &p1, const QColor& color){ void IntelliImage::drawPixel(const QPoint &p1, const QColor& color){
if(fastRenderering){ if(fastRenderering) {
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32); this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
} }
// Used to draw on the widget // Used to draw on the widget
@@ -66,13 +66,13 @@ void IntelliImage::drawPixel(const QPoint &p1, const QColor& color){
// Draw a line from the last registered point to the current // Draw a line from the last registered point to the current
painter.drawPoint(p1); painter.drawPoint(p1);
if(fastRenderering){ if(fastRenderering) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8); this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
} }
} }
void IntelliImage::drawPoint(const QPoint &p1, const QColor& color, const int& penWidth){ void IntelliImage::drawPoint(const QPoint &p1, const QColor& color, const int& penWidth){
if(fastRenderering){ if(fastRenderering) {
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32); this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
} }
// Used to draw on the widget // Used to draw on the widget
@@ -82,13 +82,13 @@ void IntelliImage::drawPoint(const QPoint &p1, const QColor& color, const int& p
painter.setPen(QPen(color, penWidth, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setPen(QPen(color, penWidth, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
// Draw a line from the last registered point to the current // Draw a line from the last registered point to the current
painter.drawPoint(p1); painter.drawPoint(p1);
if(fastRenderering){ if(fastRenderering) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8); this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
} }
} }
void IntelliImage::drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth){ void IntelliImage::drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth){
if(fastRenderering){ if(fastRenderering) {
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32); this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
} }
// Used to draw on the widget // Used to draw on the widget
@@ -99,23 +99,23 @@ void IntelliImage::drawLine(const QPoint &p1, const QPoint& p2, const QColor& co
// Draw a line from the last registered point to the current // Draw a line from the last registered point to the current
painter.drawLine(p1, p2); painter.drawLine(p1, p2);
if(fastRenderering){ if(fastRenderering) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8); this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
} }
} }
void IntelliImage::drawPlain(const QColor& color){ void IntelliImage::drawPlain(const QColor& color){
if(fastRenderering){ if(fastRenderering) {
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32); this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
} }
imageData.fill(color); imageData.fill(color);
if(fastRenderering){ if(fastRenderering) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8); this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
} }
} }
QColor IntelliImage::getPixelColor(QPoint& point){ QColor IntelliImage::getPixelColor(QPoint& point){
if(fastRenderering){ if(fastRenderering) {
QImage copy = this->imageData.convertToFormat(QImage::Format_ARGB32); QImage copy = this->imageData.convertToFormat(QImage::Format_ARGB32);
return copy.pixelColor(point); return copy.pixelColor(point);
} }
@@ -124,7 +124,7 @@ QColor IntelliImage::getPixelColor(QPoint& point){
QImage IntelliImage::getImageData(){ QImage IntelliImage::getImageData(){
QImage copy = imageData; QImage copy = imageData;
if(fastRenderering){ if(fastRenderering) {
copy = copy.convertToFormat(QImage::Format_ARGB32); copy = copy.convertToFormat(QImage::Format_ARGB32);
} }
return copy; return copy;
@@ -132,7 +132,7 @@ QImage IntelliImage::getImageData(){
void IntelliImage::setImageData(const QImage& newData){ void IntelliImage::setImageData(const QImage& newData){
imageData = newData; imageData = newData;
if(fastRenderering){ if(fastRenderering) {
this->imageData = imageData.convertToFormat(QImage::Format_Indexed8); this->imageData = imageData.convertToFormat(QImage::Format_Indexed8);
} }
else { else {
@@ -142,7 +142,7 @@ void IntelliImage::setImageData(const QImage& newData){
void IntelliImage::updateRendererSetting(bool fastRendererOn){ void IntelliImage::updateRendererSetting(bool fastRendererOn){
this->fastRenderering = fastRendererOn; this->fastRenderering = fastRendererOn;
if(fastRenderering){ if(fastRenderering) {
this->imageData = imageData.convertToFormat(QImage::Format_Indexed8); this->imageData = imageData.convertToFormat(QImage::Format_Indexed8);
} }
else { else {

View File

@@ -30,7 +30,7 @@ QImage IntelliRasterImage::getDisplayable(int alpha){
QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){ QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){
QImage copy = imageData; QImage copy = imageData;
if(fastRenderering){ if(fastRenderering) {
copy = copy.convertToFormat(QImage::Format_ARGB32); copy = copy.convertToFormat(QImage::Format_ARGB32);
} }
for(int y = 0; y<copy.height(); y++) { for(int y = 0; y<copy.height(); y++) {
@@ -40,7 +40,7 @@ QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){
copy.setPixelColor(x,y, clr); copy.setPixelColor(x,y, clr);
} }
} }
if(fastRenderering){ if(fastRenderering) {
copy = copy.convertToFormat(QImage::Format_Indexed8); copy = copy.convertToFormat(QImage::Format_Indexed8);
} }
return copy.scaled(displaySize,Qt::IgnoreAspectRatio); return copy.scaled(displaySize,Qt::IgnoreAspectRatio);

View File

@@ -27,7 +27,7 @@ IntelliImage* IntelliShapedImage::getDeepCopy(){
} }
void IntelliShapedImage::calculateVisiblity(){ void IntelliShapedImage::calculateVisiblity(){
if(fastRenderering){ if(fastRenderering) {
this->imageData = imageData.convertToFormat(QImage::Format_ARGB32); this->imageData = imageData.convertToFormat(QImage::Format_ARGB32);
} }
@@ -40,7 +40,7 @@ void IntelliShapedImage::calculateVisiblity(){
imageData.setPixelColor(x,y,clr); imageData.setPixelColor(x,y,clr);
} }
} }
if(fastRenderering){ if(fastRenderering) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8); this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
} }
return; return;
@@ -59,14 +59,14 @@ void IntelliShapedImage::calculateVisiblity(){
imageData.setPixelColor(x,y,clr); imageData.setPixelColor(x,y,clr);
} }
} }
if(fastRenderering){ if(fastRenderering) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8); this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
} }
} }
QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){ QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
QImage copy = imageData; QImage copy = imageData;
if(fastRenderering){ if(fastRenderering) {
copy = copy.convertToFormat(QImage::Format_ARGB32); copy = copy.convertToFormat(QImage::Format_ARGB32);
} }
for(int y = 0; y<copy.height(); y++) { for(int y = 0; y<copy.height(); y++) {
@@ -76,7 +76,7 @@ QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
copy.setPixelColor(x,y, clr); copy.setPixelColor(x,y, clr);
} }
} }
if(fastRenderering){ if(fastRenderering) {
copy = copy.convertToFormat(QImage::Format_Indexed8); copy = copy.convertToFormat(QImage::Format_Indexed8);
} }
return copy.scaled(displaySize,Qt::IgnoreAspectRatio); return copy.scaled(displaySize,Qt::IgnoreAspectRatio);

View File

@@ -43,9 +43,9 @@ PaintingArea::~PaintingArea(){
} }
void PaintingArea::setRenderSettings(bool isFastRenderingOn){ void PaintingArea::setRenderSettings(bool isFastRenderingOn){
if(isFastRenderingOn != renderSettings.isFastRenderering()){ if(isFastRenderingOn != renderSettings.isFastRenderering()) {
renderSettings.setFastRendering(isFastRenderingOn); renderSettings.setFastRendering(isFastRenderingOn);
for(auto& layer : layerBundle){ for(auto& layer : layerBundle) {
layer.image->updateRendererSetting(isFastRenderingOn); layer.image->updateRendererSetting(isFastRenderingOn);
} }
} }
@@ -86,7 +86,7 @@ void PaintingArea::deleteLayer(int idx){
if(activeLayer>=idx) { if(activeLayer>=idx) {
activeLayer--; activeLayer--;
} }
if(activeLayer < 0 && layerBundle.size()){ if(activeLayer < 0 && layerBundle.size()) {
activeLayer=0; activeLayer=0;
} }
} }
@@ -265,7 +265,7 @@ std::vector<QPoint> PaintingArea::getPolygonDataOfRealLayer(){
// left button and if so store the current position // left button and if so store the current position
// Set that we are currently drawing // Set that we are currently drawing
void PaintingArea::mousePressEvent(QMouseEvent*event){ void PaintingArea::mousePressEvent(QMouseEvent*event){
if(this->activeLayer < 0){ if(this->activeLayer < 0) {
return; return;
} }
if(Tool == nullptr) if(Tool == nullptr)
@@ -284,7 +284,7 @@ void PaintingArea::mousePressEvent(QMouseEvent*event){
// we call the drawline function which draws a line // we call the drawline function which draws a line
// from the last position to the current // from the last position to the current
void PaintingArea::mouseMoveEvent(QMouseEvent*event){ void PaintingArea::mouseMoveEvent(QMouseEvent*event){
if(this->activeLayer < 0){ if(this->activeLayer < 0) {
return; return;
} }
if(Tool == nullptr) if(Tool == nullptr)
@@ -428,7 +428,7 @@ int PaintingArea::getNumberOfActiveLayer(){
} }
IntelliImage* PaintingArea::getImageOfActiveLayer(){ IntelliImage* PaintingArea::getImageOfActiveLayer(){
if(activeLayer<0){ if(activeLayer<0) {
return nullptr; return nullptr;
} }
return layerBundle[activeLayer].image; return layerBundle[activeLayer].image;

View File

@@ -43,42 +43,42 @@ Q_OBJECT
friend IntelliTool; friend IntelliTool;
friend IntelliPhotoGui; friend IntelliPhotoGui;
public: public:
/*! /*!
* \brief PaintingArea is the constructor of the PaintingArea class, which initiates the working environment * \brief PaintingArea is the constructor of the PaintingArea class, which initiates the working environment
* \param maxWidth - The maximum amount of pixles that are inside painting area from left to right (default=600px) * \param maxWidth - The maximum amount of pixles that are inside painting area from left to right (default=600px)
* \param maxHeight - The maximum amount of pixles that are inside painting area from top to bottom (default=600px) * \param maxHeight - The maximum amount of pixles that are inside painting area from top to bottom (default=600px)
* \param parent - The parent window of the main window (default=nullptr) * \param parent - The parent window of the main window (default=nullptr)
*/ */
PaintingArea(int maxWidth=600, int maxHeight=600, QWidget *parent = nullptr); PaintingArea(int maxWidth=600, int maxHeight=600, QWidget*parent = nullptr);
/*! /*!
* \brief This deconstructor is used to clear up the memory and remove the currently active window * \brief This deconstructor is used to clear up the memory and remove the currently active window
*/ */
~PaintingArea() override; ~PaintingArea() override;
// Handles all events // Handles all events
/*! /*!
* \brief setRenderSettings updates all Images to the new Rendersetting. * \brief setRenderSettings updates all Images to the new Rendersetting.
* \param isFastRenderingOn is the new given flag for the FastRenderer. * \param isFastRenderingOn is the new given flag for the FastRenderer.
*/ */
void setRenderSettings(bool isFastRenderingOn); void setRenderSettings(bool isFastRenderingOn);
/*! /*!
* \brief The open method is used for loading a picture into the current layer * \brief The open method is used for loading a picture into the current layer
* \param fileName - Path and filename which are used to determine where the to-be-opened file is stored * \param fileName - Path and filename which are used to determine where the to-be-opened file is stored
* \return Returns a boolean variable whether the file was successfully opened or not * \return Returns a boolean variable whether the file was successfully opened or not
*/ */
bool open(const QString &filePath); bool open(const QString &filePath);
/*! /*!
* \brief The save method is used for exporting the current project as one picture * \brief The save method is used for exporting the current project as one picture
* \param fileName * \param fileName
* \param fileFormat * \param fileFormat
* \return Returns a boolean variable, true if the file was saved successfully, false if not * \return Returns a boolean variable, true if the file was saved successfully, false if not
*/ */
bool save(const QString &filePath, const char *fileFormat); bool save(const QString &filePath, const char*fileFormat);
/*! /*!
* \brief The addLayer adds a layer to the current project/ painting area * \brief The addLayer adds a layer to the current project/ painting area
* \param width - Width of the layer in pixles * \param width - Width of the layer in pixles
* \param height - Height of the layer in pixles * \param height - Height of the layer in pixles
@@ -87,8 +87,8 @@ public:
* \param type - Defining the ImageType of the new layer * \param type - Defining the ImageType of the new layer
* \return Returns the number of layers in the project * \return Returns the number of layers in the project
*/ */
int addLayer(int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE); int addLayer(int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE);
/*! /*!
* \brief The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack * \brief The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack
* \param idx - Index of the position the new layer should be added * \param idx - Index of the position the new layer should be added
* \param width - Width of the layer in pixles * \param width - Width of the layer in pixles
@@ -98,87 +98,87 @@ public:
* \param type - Defining the ImageType of the new layer * \param type - Defining the ImageType of the new layer
* \return Returns the id of the layer position * \return Returns the id of the layer position
*/ */
int addLayerAt(int idx, int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE); int addLayerAt(int idx, int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE);
/*! /*!
* \brief The deleteLayer method removes a layer at a given idx * \brief The deleteLayer method removes a layer at a given idx
* \param idx - The index of the layer to be removed * \param idx - The index of the layer to be removed
*/ */
void deleteLayer(int idx); void deleteLayer(int idx);
/*! /*!
* \brief The setLayerToActive method marks a specific layer as active * \brief The setLayerToActive method marks a specific layer as active
* \param idx - The index of the layer to be active * \param idx - The index of the layer to be active
*/ */
void setLayerActive(int idx); void setLayerActive(int idx);
/*! /*!
* \brief The setAlphaOfLayer method sets the alpha value of a specific layer * \brief The setAlphaOfLayer method sets the alpha value of a specific layer
* \param idx - The index of the layer where the change should be applied * \param idx - The index of the layer where the change should be applied
* \param alpha - New alpha value of the layer * \param alpha - New alpha value of the layer
*/ */
void setLayerAlpha(int idx, int alpha); void setLayerAlpha(int idx, int alpha);
/*! /*!
* \brief The floodFill method fills a the active layer with a given color * \brief The floodFill method fills a the active layer with a given color
* \param r - Red value of the color the layer should be filled with * \param r - Red value of the color the layer should be filled with
* \param g - Green value of the color the layer should be filled with * \param g - Green value of the color the layer should be filled with
* \param b - Blue value of the color the layer should be filled with * \param b - Blue value of the color the layer should be filled with
* \param a - Alpha value of the color the layer should be filled with * \param a - Alpha value of the color the layer should be filled with
*/ */
void floodFill(int r, int g, int b, int a); void floodFill(int r, int g, int b, int a);
/*! /*!
* \brief The movePositionActive method moves the active layer to certain position * \brief The movePositionActive method moves the active layer to certain position
* \param x - The x value the new center of the layer should be at * \param x - The x value the new center of the layer should be at
* \param y - The y value the new center of the layer should be at * \param y - The y value the new center of the layer should be at
*/ */
void movePositionActive(int x, int y); void movePositionActive(int x, int y);
/*! /*!
* \brief The moveActiveLayer moves the active layer to a specific position in the layer stack * \brief The moveActiveLayer moves the active layer to a specific position in the layer stack
* \param idx - The index of the new position the layer should be in * \param idx - The index of the new position the layer should be in
*/ */
void moveActiveLayer(int idx); void moveActiveLayer(int idx);
//change properties of colorPicker //change properties of colorPicker
/*! /*!
* \brief The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color * \brief The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color
*/ */
void colorPickerSetFirstColor(); void colorPickerSetFirstColor();
/*! /*!
* \brief The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color * \brief The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color
*/ */
void colorPickerSetSecondColor(); void colorPickerSetSecondColor();
/*! /*!
* \brief The colorPickerSwitchColor swaps the primary color with the secondary drawing color * \brief The colorPickerSwitchColor swaps the primary color with the secondary drawing color
*/ */
void colorPickerSwapColors(); void colorPickerSwapColors();
// Create tools // Create tools
void createPenTool(); void createPenTool();
void createPlainTool(); void createPlainTool();
void createLineTool(); void createLineTool();
void createRectangleTool(); void createRectangleTool();
void createCircleTool(); void createCircleTool();
void createPolygonTool(); void createPolygonTool();
void createFloodFillTool(); void createFloodFillTool();
/*! /*!
* \brief The getWidthOfActive gets the horizontal dimensions of the active layer * \brief The getWidthOfActive gets the horizontal dimensions of the active layer
* \return Returns the horizontal pixle count of the active layer * \return Returns the horizontal pixle count of the active layer
*/ */
int getWidthOfActive(); int getWidthOfActive();
/*! /*!
* \brief The getHeightOfActive gets the vertical dimensions of the active layer * \brief The getHeightOfActive gets the vertical dimensions of the active layer
* \return Returns the vertical pixle count of the active layer * \return Returns the vertical pixle count of the active layer
*/ */
int getHeightOfActive(); int getHeightOfActive();
IntelliImage::ImageType getTypeOfImageRealLayer(); IntelliImage::ImageType getTypeOfImageRealLayer();
std::vector<QPoint> getPolygonDataOfRealLayer(); std::vector<QPoint> getPolygonDataOfRealLayer();
int getNumberOfActiveLayer(); int getNumberOfActiveLayer();
IntelliImage* getImageOfActiveLayer(); IntelliImage* getImageOfActiveLayer();
IntelliToolsettings Toolsettings; IntelliToolsettings Toolsettings;
IntelliColorPicker colorPicker; IntelliColorPicker colorPicker;
public slots: public slots:
// Events to handle // Events to handle
@@ -226,8 +226,8 @@ void drawLayers(bool forSaving=false);
void resizeLayer(QImage*image_res, const QSize &newSize); void resizeLayer(QImage*image_res, const QSize &newSize);
// Helper for Tool // Helper for Tool
bool createTempTopLayer(int idx); bool createTempTopLayer(int idx);
}; };
#endif #endif

View File

@@ -25,7 +25,7 @@ void IntelliTool::onMouseRightReleased(int x, int y){
void IntelliTool::onMouseLeftPressed(int x, int y){ void IntelliTool::onMouseLeftPressed(int x, int y){
this->isDrawing=this->createToolLayer(); this->isDrawing=this->createToolLayer();
if(isDrawing){ if(isDrawing) {
Canvas->image->calculateVisiblity(); Canvas->image->calculateVisiblity();
} }
} }
@@ -49,7 +49,7 @@ void IntelliTool::onWheelScrolled(int value){
} }
bool IntelliTool::createToolLayer(){ bool IntelliTool::createToolLayer(){
if(Area->createTempTopLayer(Area->activeLayer)){ if(Area->createTempTopLayer(Area->activeLayer)) {
this->activeLayer=&Area->layerBundle[static_cast<unsigned long long>(Area->activeLayer)]; this->activeLayer=&Area->layerBundle[static_cast<unsigned long long>(Area->activeLayer)];
this->Canvas=&Area->layerBundle[static_cast<unsigned long long>(Area->activeLayer+1)]; this->Canvas=&Area->layerBundle[static_cast<unsigned long long>(Area->activeLayer+1)];
return true; return true;

View File

@@ -56,7 +56,7 @@ void IntelliToolCircle::onMouseRightReleased(int x, int y){
void IntelliToolCircle::onMouseLeftPressed(int x, int y){ void IntelliToolCircle::onMouseLeftPressed(int x, int y){
IntelliTool::onMouseLeftPressed(x,y); IntelliTool::onMouseLeftPressed(x,y);
if(this->isDrawing){ if(this->isDrawing) {
this->centerPoint=QPoint(x,y); this->centerPoint=QPoint(x,y);
int radius = 1; int radius = 1;
drawCircle(radius); drawCircle(radius);