Fix free drawing in gtk129

This commit is contained in:
daleclack 2022-05-20 11:20:54 +08:00
parent 8560465aa2
commit cd06416cf9
2 changed files with 13 additions and 10 deletions

View File

@ -50,7 +50,7 @@ add_custom_target(resource ALL DEPENDS ${RESOURCE_FILE})
#For win32 platform,use rc resource and .ico icon
if(WIN32)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
SET(CMAKE_RC_COMPILER windres)
set(app_WINRC ../icon.rc)
set_property(SOURCE ../icon.rc APPEND PROPERTY
OBJECT_DEPENDS ${PROJECT_SOURCE_DIR}/../icon.ico

View File

@ -223,16 +223,19 @@ void Drawing::button_press(int n_press, double x, double y)
switch (button)
{
case 1:
if (begin && drawing_mode != DrawMode::Default)
if (drawing_mode != DrawMode::Default)
{
begin = !begin;
rel_x = x;
rel_y = y;
}
else
{
begin = !begin;
draw_brush(x, y, DrawProcess::End);
if (begin)
{
begin = !begin;
rel_x = x;
rel_y = y;
}
else
{
begin = !begin;
draw_brush(x, y, DrawProcess::End);
}
}
break;
case 3: