Fix hitting grip if grip overlaps with other elements
This commit is contained in:
parent
7fa89d396f
commit
c7397bb00f
2 changed files with 6 additions and 0 deletions
|
@ -507,6 +507,7 @@ void NotationViewInputController::mousePressEvent(QMouseEvent* event)
|
|||
ctx.logicClickPos = logicPos;
|
||||
ctx.hitElement = hitElement;
|
||||
ctx.prevHitElement = prevHitElement;
|
||||
ctx.isHitGrip = viewInteraction()->isHitGrip(logicPos);
|
||||
ctx.event = event;
|
||||
|
||||
if (needSelect(ctx)) {
|
||||
|
@ -533,6 +534,10 @@ void NotationViewInputController::mousePressEvent(QMouseEvent* event)
|
|||
|
||||
bool NotationViewInputController::needSelect(const ClickContext& ctx) const
|
||||
{
|
||||
if (ctx.isHitGrip && ctx.event->button() == Qt::LeftButton) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ctx.hitElement) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -153,6 +153,7 @@ private:
|
|||
const QMouseEvent* event = nullptr;
|
||||
Ms::EngravingItem* hitElement = nullptr;
|
||||
const Ms::EngravingItem* prevHitElement = nullptr;
|
||||
bool isHitGrip = false;
|
||||
};
|
||||
|
||||
bool needSelect(const ClickContext& ctx) const;
|
||||
|
|
Loading…
Reference in a new issue