From ab4fa4bfec81eaaa66041271a8a0dd9585f9eeaf Mon Sep 17 00:00:00 2001 From: manongjohn Date: May 18 2018 04:57:28 +0000 Subject: Fix note icon drag area in timeline (#1961) --- diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp index 9a8a690..1abe4a9 100644 --- a/toonz/sources/toonz/xshcellviewer.cpp +++ b/toonz/sources/toonz/xshcellviewer.cpp @@ -2440,7 +2440,7 @@ void CellArea::mousePressEvent(QMouseEvent *event) { int c = notes->getNoteCol(i); QPoint xy = m_viewer->positionToXY(CellPosition(r, c)); TPointD pos = notes->getNotePos(i) + TPointD(xy.x(), xy.y()); - QRect rect(pos.x, pos.y, NoteWidth, NoteHeight); + QRect rect = o->rect(PredefinedRect::NOTE_ICON).translated(pos.x, pos.y); if (!rect.contains(event->pos())) continue; setDragTool(XsheetGUI::DragTool::makeNoteMoveTool(m_viewer)); m_viewer->setCurrentNoteIndex(i); @@ -2757,7 +2757,7 @@ void CellArea::mouseDoubleClickEvent(QMouseEvent *event) { int c = notes->getNoteCol(i); QPoint xy = m_viewer->positionToXY(CellPosition(r, c)); TPointD pos = notes->getNotePos(i) + TPointD(xy.x(), xy.y()); - QRect rect(pos.x, pos.y, NoteWidth, NoteHeight); + QRect rect = o->rect(PredefinedRect::NOTE_ICON).translated(pos.x, pos.y); if (!rect.contains(event->pos())) continue; m_viewer->setCurrentNoteIndex(i); m_viewer->getNotesWidget().at(i)->openNotePopup(); @@ -2823,7 +2823,7 @@ void CellArea::contextMenuEvent(QContextMenuEvent *event) { int c = notes->getNoteCol(i); QPoint xy = m_viewer->positionToXY(CellPosition(r, c)); TPointD pos = notes->getNotePos(i) + TPointD(xy.x(), xy.y()); - QRect rect(pos.x, pos.y, NoteWidth, NoteHeight); + QRect rect = o->rect(PredefinedRect::NOTE_ICON).translated(pos.x, pos.y); if (!rect.contains(event->pos())) continue; m_viewer->setCurrentNoteIndex(i); createNoteMenu(menu);