diff --git a/COMPILING.MD b/COMPILING.MD index 1726bea1..c551804d 100644 --- a/COMPILING.MD +++ b/COMPILING.MD @@ -1,4 +1,4 @@ -# Building Image Uploader on Windows +# Building Image Uploader on Windows To build Image Uploader from source files you will need: diff --git a/Source/Image Uploader.rc b/Source/Image Uploader.rc index 6137c84a..8a48ee70 100644 --- a/Source/Image Uploader.rc +++ b/Source/Image Uploader.rc @@ -777,28 +777,28 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFR CAPTION "History" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - LTEXT "#",IDC_ANIMATIONSTATIC,379,3,23,17 CONTROL "Check1",IDC_DOWNLOADTHUMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,9,151,10 + LTEXT "#",IDC_ANIMATIONSTATIC,379,3,23,17 LISTBOX IDC_HISTORYTREE,4,26,398,224,LBS_OWNERDRAWVARIABLE | LBS_NOINTEGRALHEIGHT | LBS_WANTKEYBOARDINPUT | WS_VSCROLL | WS_TABSTOP GROUPBOX "#Filters",IDC_FILTERSGROUPBOX,4,253,398,63,0,WS_EX_TRANSPARENT CONTROL "#Date from:",IDC_DATEFROMCHECKBOX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,264,81,10 CONTROL "",IDC_DATEFROMPICKER,"SysDateTimePick32",DTS_RIGHTALIGN | WS_TABSTOP,97,261,100,15 + CTEXT "#to:",IDC_DATETOLABEL,201,264,36,8 CONTROL "",IDC_DATETOPICKER,"SysDateTimePick32",DTS_RIGHTALIGN | WS_TABSTOP,240,261,100,15 LTEXT "#Filename:",IDC_FILENAMELABEL,11,282,57,8 - CTEXT "#to:",IDC_DATETOLABEL,201,264,36,8 EDITTEXT IDC_FILENAMEEDIT,70,280,128,14,ES_AUTOHSCROLL CTEXT "#URL:",IDC_URLLABEL,200,282,38,8 EDITTEXT IDC_URLEDIT,240,280,144,14,ES_AUTOHSCROLL + PUSHBUTTON "#Apply",IDOK,8,297,93,14 PUSHBUTTON "Clear filters",IDC_CLEARFILTERS,106,297,92,14 LTEXT "Total sessions:",IDC_SESSIONSCOUNTDESCR,12,326,75,8 - LTEXT "Total files:",IDC_FILESCOUNTDESCR,12,340,68,8 LTEXT "0",IDC_SESSIONSCOUNTLABEL,89,327,55,8 - LTEXT "0",IDC_FILESCOUNTLABEL,89,340,56,8 LTEXT "Traffic:",IDC_UPLOADTRAFFICDESCR,151,327,75,8 LTEXT "0",IDC_UPLOADTRAFFICLABEL,229,327,83,8 + LTEXT "Total files:",IDC_FILESCOUNTDESCR,12,340,68,8 + LTEXT "0",IDC_FILESCOUNTLABEL,89,340,56,8 PUSHBUTTON "#Clear History",IDC_CLEARHISTORYBTN,150,345,112,14 PUSHBUTTON "Close",IDCANCEL,342,345,60,15 - PUSHBUTTON "#Apply",IDOK,8,297,93,14 END IDD_THUMBEDITOR DIALOGEX 0, 0, 261, 174 diff --git a/Source/ImageEditor/Canvas.cpp b/Source/ImageEditor/Canvas.cpp index 3ba76648..996447fc 100644 --- a/Source/ImageEditor/Canvas.cpp +++ b/Source/ImageEditor/Canvas.cpp @@ -1528,6 +1528,10 @@ void Canvas::setCropOnExport(bool crop) { cropOnExport_ = crop; } +bool Canvas::getCropOnExport() const { + return cropOnExport_; +} + void Canvas::setDpi(float dpiX, float dpiY) { dpiX_ = dpiX; dpiY_ = dpiY; diff --git a/Source/ImageEditor/Canvas.h b/Source/ImageEditor/Canvas.h index d8d74276..34ced9ca 100644 --- a/Source/ImageEditor/Canvas.h +++ b/Source/ImageEditor/Canvas.h @@ -186,6 +186,7 @@ class Canvas { bool hasElementOfType(ElementType type) const; void setCropOnExport(bool crop); + bool getCropOnExport() const; void setDpi(float dpiX, float dpiY); std::pair getDpi() const; diff --git a/Source/ImageEditor/DrawingTools/ColorPickerTool.cpp b/Source/ImageEditor/DrawingTools/ColorPickerTool.cpp index 5eb84f1b..175f6c1d 100644 --- a/Source/ImageEditor/DrawingTools/ColorPickerTool.cpp +++ b/Source/ImageEditor/DrawingTools/ColorPickerTool.cpp @@ -42,13 +42,17 @@ void ColorPickerTool::continueDraw(int x, int y, DWORD flags) void ColorPickerTool::endDraw(int x, int y) { + bool oldValue = canvas_->getCropOnExport(); + canvas_->setCropOnExport(false); auto bmp = canvas_->getBitmapForExport(); + canvas_->setCropOnExport(oldValue); if (bmp) { Gdiplus::Color color; if (bmp->GetPixel(x, y, &color) == Gdiplus::Ok) { canvas_->setForegroundColor(color); canvas_->onForegroundColorChanged(color); canvas_->setPreviousDrawingTool(); + // On this line "this" object has been already destroyed } } } @@ -65,7 +69,10 @@ ImageEditor::CursorType ColorPickerTool::getCursor(int x, int y) void ColorPickerTool::rightButtonClick(int x, int y) { + bool oldValue = canvas_->getCropOnExport(); + canvas_->setCropOnExport(false); auto bmp = canvas_->getBitmapForExport(); + canvas_->setCropOnExport(oldValue); if (bmp) { Gdiplus::Color color; if (bmp->GetPixel(x, y, &color) == Gdiplus::Ok) { @@ -73,8 +80,9 @@ void ColorPickerTool::rightButtonClick(int x, int y) canvas_->onBackgroundColorChanged(color); canvas_->setPreviousDrawingTool(); + // On this line "this" object has been already destroyed } } } -} \ No newline at end of file +}