Skip to content

Commit

Permalink
Merge branch 'blend2d' of https://github.com/xland/ScreenCapture into…
Browse files Browse the repository at this point in the history
… blend2d
  • Loading branch information
unknown committed Sep 3, 2023
2 parents d48e983 + 0e4ae4c commit d907eba
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
Binary file modified Doc/Logo.psd
Binary file not shown.
12 changes: 5 additions & 7 deletions ScreenCapture/MainWin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,16 @@ void MainWin::setToolBoxPos()
//尚未确定state,主工具条贴着截图区底部上方,并为子工具条留出空间
toolBoxMain.y0 = cutBox.y1 - (double)toolBoxSpan * 2 - (double)toolBoxHeight * 2;
}
}
if (toolBoxMain.x0 < 0) {
//如果工具条超出了屏幕左侧,那么让工具条与截图区域左侧对齐
toolBoxMain.x0 = cutBox.x0;
toolBoxMain.x0 -= toolBoxSpan;
}
toolBoxMain.y1 = toolBoxMain.y0 + toolBoxHeight;
toolBoxMain.x1 = toolBoxMain.x0 + toolBoxWidth;
bool flag = true;
for (size_t i = 0; i < screens.size(); i++)
{
if (screens[i].contains(toolBoxMain.x1, toolBoxMain.y1)
|| screens[i].contains(toolBoxMain.x1 - toolBoxWidth, toolBoxMain.y1- toolBoxHeight/2)
) {
auto x = this->x + toolBoxMain.x0 + toolBoxWidth / 2;
auto y = this->y + toolBoxMain.y0 + toolBoxHeight / 2;
if (screens[i].contains(x,y)) {
flag = false;
break;
}
Expand All @@ -182,6 +179,7 @@ void MainWin::setToolBoxPos()
//尚未确定state,主工具条贴着截图区底部上方,并为子工具条留出空间
toolBoxMain.y0 = cutBox.y1 - (double)toolBoxSpan * 2 - (double)toolBoxHeight * 2;
}
toolBoxMain.x0 -= toolBoxSpan;
toolBoxMain.y1 = toolBoxMain.y0 + toolBoxHeight;
toolBoxMain.x1 = toolBoxMain.x0 + toolBoxWidth;
}
Expand Down
Binary file modified ScreenCapture/Res/Logo.ico
Binary file not shown.
Binary file modified ScreenCapture/ScreenCapture.aps
Binary file not shown.
Binary file modified ScreenCapture/ScreenCapture.rc
Binary file not shown.
6 changes: 3 additions & 3 deletions ScreenCapture/WindowBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <format>
#include "MainWin.h"
#include "PinWin.h"
#include <thread>
#include "resource.h"

/// <summary>
/// 0 undefined
Expand Down Expand Up @@ -99,8 +99,8 @@ void WindowBase::InitWindow()
wcx.lpfnWndProc = &WindowBase::RouteWindowMessage;
wcx.cbWndExtra = sizeof(WindowBase*);
wcx.hInstance = hinstance;
wcx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
wcx.hIcon = LoadIcon(hinstance, MAKEINTRESOURCE(IDI_ICON1));;
wcx.hCursor = LoadCursor(hinstance, IDC_ARROW);
wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wcx.lpszClassName = className.c_str();
if (!RegisterClassEx(&wcx))
Expand Down

0 comments on commit d907eba

Please sign in to comment.