Skip to content

[Bug] delegate handles do not work with tablet pen #221

@letsfindaway

Description

@letsfindaway

Reported here: OpenBoard-org#1270 (comment)

The function isUnderMouse() is not suitable to detect a tool when using a tablet pen. The first proposal from @fadikdawoud is to revert the changes I have introduced with ba0eedd.

Further analysis:

  • It might be that isUnderMouse() does not work as expected when using a tablet pen, probably because QCurssor::pos() is not updated when this function is called.
  • Reverting the changes is not an option, as this introduces the original problem: The cursor shape does not correspond to the action taken when pressing the mouse button.
  • Only using the reverse sequence but otherwise the old code is also not an option. The functions like rotateButtonBounds() do not exactly correspond to the button outline and therefore the misalignment between cursor shape and action remains.

My proposed solution is now to use mRotateButton->contains(mRotateButton->mapFromScene(pos)) etc. and to invoke toolFromPos() with the scene position. This code guarantees alignment between cursor shape and action and uses the position provided by the event.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.7.4bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions