Skip to content

Commit a91eb93

Browse files
author
Gleb Baryshev
committed
merge pull requests kelvie#5 and kelvie#6
3 parents 65f78aa + c010090 + d771cc0 commit a91eb93

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/basketscene.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include <QtGui/QClipboard>
5353
#include <QtGui/QInputDialog>
5454
#include <QtGui/QGraphicsProxyWidget>
55+
#include <QtGui/QScrollBar>
5556
#include <QtXml/QDomDocument>
5657

5758
#include <KDE/KTextEdit>
@@ -1319,7 +1320,8 @@ void BasketScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
13191320
if( m_editor && !shiftPressed && !controlPressed )
13201321
{
13211322
//if the mouse is over the editor
1322-
QGraphicsWidget *widget = dynamic_cast<QGraphicsWidget*>(m_view->itemAt(event->scenePos().toPoint()));
1323+
QPoint view_shift(m_view->horizontalScrollBar()->value(), m_view->verticalScrollBar()->value());
1324+
QGraphicsWidget *widget = dynamic_cast<QGraphicsWidget*>(m_view->itemAt((event->scenePos() - view_shift).toPoint()));
13231325
if(widget && m_editor->graphicsWidget() == widget)
13241326
{
13251327
if(event->button() == Qt::LeftButton)
@@ -1821,6 +1823,8 @@ void BasketScene::dropEvent(QGraphicsSceneDragDropEvent *event)
18211823
// Then noteAt() is called for the mouse pointer position, because the basket is now smaller, the cursor is out of boundaries!!!
18221824
// Should, of course, not return 0:
18231825
Note *clicked = noteAt(pos);
1826+
if(clicked && clicked->allSelected())
1827+
clicked = 0;
18241828

18251829
if (NoteFactory::movingNotesInTheSameBasket(event->mimeData(), this, event->dropAction()) && event->dropAction() == Qt::MoveAction) {
18261830
m_doNotCloseEditor = true;

0 commit comments

Comments
 (0)