Added disable touch for drawing option
This commit is contained in:
parent
f42da47b6e
commit
d60e0ba47b
5 changed files with 9 additions and 3 deletions
|
|
@ -121,7 +121,8 @@ void DrawingProgram::input_text_callback(const InputManager::TextCallbackArgs& t
|
|||
|
||||
void DrawingProgram::input_mouse_button_callback(const InputManager::MouseButtonCallbackArgs& button) {
|
||||
auto buttonCallbacks = [&](const InputManager::MouseButtonCallbackArgs& b) {
|
||||
drawTool->input_mouse_button_on_canvas_callback(b);
|
||||
if(b.deviceType == InputManager::MouseDeviceType::TOUCH && !world.main.conf.disableTouchForDrawing)
|
||||
drawTool->input_mouse_button_on_canvas_callback(b);
|
||||
};
|
||||
|
||||
if(button.down) {
|
||||
|
|
@ -173,7 +174,8 @@ void DrawingProgram::input_mouse_button_callback(const InputManager::MouseButton
|
|||
}
|
||||
|
||||
void DrawingProgram::input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion) {
|
||||
drawTool->input_mouse_motion_callback(motion);
|
||||
if(motion.deviceType == InputManager::MouseDeviceType::TOUCH && !world.main.conf.disableTouchForDrawing)
|
||||
drawTool->input_mouse_motion_callback(motion);
|
||||
}
|
||||
|
||||
void DrawingProgram::input_key_callback(const InputManager::KeyCallbackArgs& key) {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ class GlobalConfig {
|
|||
bool zoomWhilePenDownAndButtonHeld = true;
|
||||
} tabletOptions;
|
||||
|
||||
bool disableTouchForDrawing = false;
|
||||
|
||||
Vector3f defaultCanvasBackgroundColor = DEFAULT_CANVAS_BACKGROUND_COLOR;
|
||||
|
||||
nlohmann::json get_config_json(const InputManager& input) const;
|
||||
|
|
|
|||
|
|
@ -821,7 +821,7 @@ void InputManager::backend_touch_finger_up_update(const SDL_TouchFingerEvent& e)
|
|||
}
|
||||
|
||||
void InputManager::backend_touch_finger_motion_update(const SDL_TouchFingerEvent& e) {
|
||||
constexpr float MINIMUM_MOTION_TO_CONSIDER_SQRD = 20.0f * 20.0f;
|
||||
constexpr float MINIMUM_MOTION_TO_CONSIDER_SQRD = 30.0f * 30.0f;
|
||||
|
||||
isTouchDevice = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -1157,6 +1157,7 @@ void FileSelectScreen::settings_view() {
|
|||
slider_scalar_field(gui, "tablet brush minimum size", "Brush relative minimum size", &main.conf.tabletOptions.brushMinimumSize, 0.0f, 1.0f, {.decimalPrecision = 3});
|
||||
slider_scalar_field(gui, "tablet brush pressure smoothing factor", "Brush pressure smoothing factor", &main.conf.tabletOptions.brushPressureSmoothingFactor, 0.0f, 1.0f, {.decimalPrecision = 3});
|
||||
checkbox_boolean_field(gui, "pen pressure width", "Pen pressure affects brush size", &main.conf.tabletOptions.pressureAffectsBrushWidth);
|
||||
checkbox_boolean_field(gui, "disable touch for drawing", "Disable touch for drawing", &main.conf.disableTouchForDrawing);
|
||||
text_label(gui, "VSync:");
|
||||
radio_button_selector(gui, "VSync selector", &main.conf.vsyncValue, {
|
||||
{"On", 1},
|
||||
|
|
|
|||
|
|
@ -1528,6 +1528,7 @@ void Toolbar::general_settings_inner_gui() {
|
|||
input_scalar_field(gui, "jump transition time", "Jump transition time", &main.conf.jumpTransitionTime, 0.01f, 1000.0f, {.decimalPrecision = 2});
|
||||
|
||||
checkbox_boolean_field(gui, "real time eraser", "Eraser works in real time", &main.conf.realTimeEraser);
|
||||
checkbox_boolean_field(gui, "disable touch for drawing", "Disable touch for drawing", &main.conf.disableTouchForDrawing);
|
||||
checkbox_boolean_field(gui, "force extension on path", "Force extension on path when saving files", &main.conf.forceExtensionOnPath);
|
||||
#ifdef ADD_PREFER_X11_OPTION
|
||||
checkbox_boolean_field(gui, "prefer x11", "Prefer X11 over Wayland (Requires restart)", &main.conf.preferX11);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue