Browse Source

ModuleWidget.cpp - add hand cursor

pull/1941/head
Steve Russell GitHub 1 month ago
parent
commit
3b61f050f1
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      src/app/ModuleWidget.cpp

+ 7
- 2
src/app/ModuleWidget.cpp View File

@@ -444,7 +444,10 @@ void ModuleWidget::onButton(const ButtonEvent& e) {
void ModuleWidget::onDragStart(const DragStartEvent& e) {
if (e.button == GLFW_MOUSE_BUTTON_LEFT) {
// HACK Disable FramebufferWidget redrawing subpixels while dragging
APP->window->fbDirtyOnSubpixelChange() = false;
// APP->window->fbDirtyOnSubpixelChange() = false;
if (!settings::lockModules) {
glfwSetCursor(APP->window->win, glfwCreateStandardCursor(GLFW_HAND_CURSOR));
}

// Clear dragRack so dragging in not enabled until mouse is moved a bit.
internal->dragRackPos = math::Vec(NAN, NAN);
@@ -458,6 +461,8 @@ void ModuleWidget::onDragEnd(const DragEndEvent& e) {
if (e.button == GLFW_MOUSE_BUTTON_LEFT) {
APP->window->fbDirtyOnSubpixelChange() = true;

glfwSetCursor(APP->window->win, NULL);

// The next time the module is dragged, it should always move immediately
internal->dragEnabled = true;

@@ -1157,4 +1162,4 @@ engine::Module* ModuleWidget::releaseModule() {


} // namespace app
} // namespace rack
} // namespace rack

Loading…
Cancel
Save