fix layer delete order bug, fix and improve brush preview during the stroke, fix windows mouse capture (api works only on the main thread)

This commit is contained in:
2018-11-03 23:44:09 +01:00
parent 3ee10bb88d
commit eb1c8d6b7a
6 changed files with 37 additions and 17 deletions

View File

@@ -953,10 +953,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
break;
case WM_LBUTTONDOWN:
{
SetCapture(hWnd);
std::lock_guard<std::mutex> lock(task_mutex);
auto pt = lastPoint;
tasklist.emplace_back([pt, extra, hWnd, p = WacomTablet::I.get_pressure()]{
SetCapture(hWnd);
kEventSource pointer_source;
if (WacomTablet::I.m_ink_pen || WacomTablet::I.m_ink_touch)
{
@@ -974,11 +974,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
break;
case WM_LBUTTONUP:
{
ReleaseCapture();
std::lock_guard<std::mutex> lock(task_mutex);
auto pt = lastPoint;
tasklist.emplace_back([pt, extra] {
WacomTablet::I.reset_pressure();
ReleaseCapture();
kEventSource pointer_source;
if (WacomTablet::I.m_ink_pen || WacomTablet::I.m_ink_touch)
{
@@ -996,10 +996,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
break;
case WM_RBUTTONDOWN:
{
SetCapture(hWnd);
std::lock_guard<std::mutex> lock(task_mutex);
auto pt = lastPoint;
tasklist.emplace_back([pt, extra, hWnd] {
SetCapture(hWnd);
kEventSource pointer_source;
if (WacomTablet::I.m_ink_pen || WacomTablet::I.m_ink_touch)
{
@@ -1017,10 +1017,10 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
break;
case WM_RBUTTONUP:
{
ReleaseCapture();
std::lock_guard<std::mutex> lock(task_mutex);
auto pt = lastPoint;
tasklist.emplace_back([pt, extra] {
ReleaseCapture();
kEventSource pointer_source;
if (WacomTablet::I.m_ink_pen || WacomTablet::I.m_ink_touch)
{