Strokes can be moved by Play tool.

preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent 33988f4d48
commit f6247a2680
  1. 12
      src/board/UBBoardView.cpp

@ -545,7 +545,6 @@ Here we determines cases when items should to get mouse press event at pressing
break; break;
// Groups shouldn't reacts on any presses and moves for Play tool. // Groups shouldn't reacts on any presses and moves for Play tool.
case UBGraphicsStrokesGroup::Type:
case UBGraphicsGroupContainerItem::Type: case UBGraphicsGroupContainerItem::Type:
if(currentTool == UBStylusTool::Play) if(currentTool == UBStylusTool::Play)
{ {
@ -631,7 +630,7 @@ bool UBBoardView::itemShouldBeMoved(QGraphicsItem *item)
case UBGraphicsGroupContainerItem::Type: case UBGraphicsGroupContainerItem::Type:
return true; return true;
case UBGraphicsW3CWidgetItem::Type: case UBGraphicsWidgetItem::Type:
if(currentTool == UBStylusTool::Selector && item->isSelected()) if(currentTool == UBStylusTool::Selector && item->isSelected())
return false; return false;
if(currentTool == UBStylusTool::Play) if(currentTool == UBStylusTool::Play)
@ -658,10 +657,6 @@ QGraphicsItem* UBBoardView::determineItemToPress(QGraphicsItem *item)
{ {
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController()->stylusTool(); UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController()->stylusTool();
// groups should should be moved instead of strokes groups
if (item->parentItem() && UBGraphicsStrokesGroup::Type == item->type())
return item->parentItem();
// if item is on group and group is not selected - group should take press. // if item is on group and group is not selected - group should take press.
if (UBStylusTool::Selector == currentTool if (UBStylusTool::Selector == currentTool
&& item->parentItem() && item->parentItem()
@ -685,7 +680,7 @@ QGraphicsItem* UBBoardView::determineItemToMove(QGraphicsItem *item)
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController()->stylusTool(); UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController()->stylusTool();
//W3C widgets should take mouse move events from play tool. //W3C widgets should take mouse move events from play tool.
if ((UBStylusTool::Play == currentTool) && (UBGraphicsW3CWidgetItem::Type == item->type())) if ((UBStylusTool::Play == currentTool) && (UBGraphicsWidgetItem::Type == item->type()))
return item; return item;
// if item is in group // if item is in group
@ -754,6 +749,9 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
void UBBoardView::handleItemMouseMove(QMouseEvent *event) void UBBoardView::handleItemMouseMove(QMouseEvent *event)
{ {
if (!movingItem)
return;
// determine item to move (maybee we need to move group of item or his parent. // determine item to move (maybee we need to move group of item or his parent.
movingItem = determineItemToMove(movingItem); movingItem = determineItemToMove(movingItem);

Loading…
Cancel
Save