diff --git a/Data/Favicons/ipic.su.ico b/Data/Favicons/ipic.su.ico deleted file mode 100644 index 7c83c177..00000000 Binary files a/Data/Favicons/ipic.su.ico and /dev/null differ diff --git a/Data/servers.xml b/Data/servers.xml index 8d2c6286..69213047 100644 --- a/Data/servers.xml +++ b/Data/servers.xml @@ -81,12 +81,6 @@ - - - - - - diff --git a/Source/Gui/Dialogs/MainDlg.cpp b/Source/Gui/Dialogs/MainDlg.cpp index bcdeddda..2a81a785 100644 --- a/Source/Gui/Dialogs/MainDlg.cpp +++ b/Source/Gui/Dialogs/MainDlg.cpp @@ -86,7 +86,7 @@ LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam UpdateStatusLabel(); ACCEL accels[] = { - { FCONTROL | FSHIFT | FVIRTKEY, VkKeyScan('c'), MENUITEM_COPYFILEPATH}, + { FCONTROL | FSHIFT | FVIRTKEY, static_cast(VkKeyScan('c')), MENUITEM_COPYFILEPATH}, { FALT | FVIRTKEY, VK_RETURN, MENUITEM_PROPERTIES}, }; diff --git a/Source/ImageEditor/DrawingTools/MoveAndResizeTool.cpp b/Source/ImageEditor/DrawingTools/MoveAndResizeTool.cpp index 27c46c70..837b6093 100644 --- a/Source/ImageEditor/DrawingTools/MoveAndResizeTool.cpp +++ b/Source/ImageEditor/DrawingTools/MoveAndResizeTool.cpp @@ -399,7 +399,7 @@ MovableElement::Grip MoveAndResizeTool::checkElementsBoundaries( int x, int y, M MovableElement::Grip MoveAndResizeTool::checkElementBoundaries(MovableElement* element, int x, int y) { for (size_t i = 0; i < element->grips_.size(); i++) { - if ( abs (x - element->grips_[i].pt.x) <= MovableElement::kGripSize+2 && abs (y - element->grips_[i].pt.y) <= MovableElement::kGripSize+2 ) { + if ( abs (x - element->grips_[i].pt.x) <= element->gripWidth_ + 2 && abs (y - element->grips_[i].pt.y) <= element->gripHeight_ + 2 ) { return element->grips_[i]; } } diff --git a/Source/ImageEditor/MovableElement.cpp b/Source/ImageEditor/MovableElement.cpp index 499f6c54..84038491 100644 --- a/Source/ImageEditor/MovableElement.cpp +++ b/Source/ImageEditor/MovableElement.cpp @@ -35,7 +35,9 @@ MovableElement::MovableElement(Canvas* canvas){ color_ = Gdiplus::Color( 0, 0, 0 ); penSize_ = 1; isSelected_ = false; - + auto [dpiX, dpiY] = canvas->getDpi(); + gripWidth_ = dpiX * kGripSize; + gripHeight_ = dpiY * kGripSize; grips_.resize(8); canvas_ = canvas; isMoving_ = false; @@ -71,8 +73,10 @@ void MovableElement::renderGrips(Painter* gr) } if ( (isSelected_ || getType() == ElementType::etCrop) && isResizable() ) { - int rectSize = kGripSize; - int halfSize = rectSize /2 ; + int rectSizeX = gripWidth_; + int rectSizeY = gripHeight_; + int halfSizeX = rectSizeX /2 ; + int halfSizeY = rectSizeY / 2; Gdiplus::Pen pen2( Color( 255,255, 255) ); //pen.SetDashStyle(DashStyleDash); /*int x = getX(); @@ -87,8 +91,8 @@ void MovableElement::renderGrips(Painter* gr) for (size_t i = 0; i < grips_.size(); i++) { int x = grips_[i].pt.x; int y = grips_[i].pt.y; - gr->FillRectangle( &brush, x-halfSize, y-halfSize, rectSize, rectSize ); - gr->DrawRectangle( &pen2, x-halfSize-1, y-halfSize-1, rectSize+1, rectSize+1 ); + gr->FillRectangle( &brush, x-halfSizeX, y-halfSizeY, rectSizeX, rectSizeY ); + gr->DrawRectangle( &pen2, x-halfSizeX-1, y-halfSizeY-1, rectSizeX+1, rectSizeY+1 ); } } @@ -146,7 +150,7 @@ int MovableElement::getY() RECT MovableElement::getPaintBoundingRect() { - int radius = (std::max)(penSize_, kGripSize); + int radius = (std::max)(penSize_, gripWidth_); if ( canvas_->hasBlurRectangles() ) { radius += static_cast(canvas_->getBlurRadius()); } diff --git a/Source/ImageEditor/MovableElement.h b/Source/ImageEditor/MovableElement.h index 5411d5c2..e94ff9f2 100644 --- a/Source/ImageEditor/MovableElement.h +++ b/Source/ImageEditor/MovableElement.h @@ -13,8 +13,9 @@ class AffectedSegments; class MovableElement: public DrawingElement { public: - - enum { kGripSize = 6 ,kSelectRadius = 5}; + + // This is sizing handle dimension when DPI scale is 100% + enum { kGripSize = 6, kSelectRadius = 5}; enum class GripPointType {gptNone, gptStartPoint, gptEndPoint}; @@ -61,6 +62,7 @@ class MovableElement: public DrawingElement { bool drawDashedRectangle_; bool drawDashedRectangleWhenSelected_; std::vector grips_; + int gripWidth_, gripHeight_; POINT* getMaxPoint(Axis axis); POINT* getMinPoint(Axis axis); @@ -72,4 +74,4 @@ class MovableElement: public DrawingElement { } -#endif \ No newline at end of file +#endif