Your ROOT_URL in app.ini is http://git.osmesh.ru/ but you are visiting http://91.221.70.94:3000/MOS/OpenBoard/commit/a748e8a2990d9f7e95c3ce9c6061cfdc084374ae?style=unified&whitespace=ignore-change
You should set ROOT_URL correctly, otherwise the web may not work correctly.
4 changed files with
41 additions and
1 deletions
src/board/UBBoardView.cpp
src/board/UBBoardView.h
src/domain/UBGraphicsStrokesGroup.cpp
src/domain/UBGraphicsStrokesGroup.h
@ -596,7 +596,7 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
mLastPressedMousePos = mapToScene ( event - > pos ( ) ) ;
if ( movingItem & & QGraphicsSvgItem : : Type ! = movingItem - > type ( )
if ( movingItem & & ! hasSelectedParents ( movingItem ) & & QGraphicsSvgItem : : Type ! = movingItem - > type ( )
& & UBGraphicsDelegateFrame : : Type ! = movingItem - > type ( )
& & ! mMultipleSelectionIsEnabled )
{
@ -1405,3 +1405,13 @@ UBBoardView::setToolCursor (int tool)
controlViewport - > setCursor ( UBResources : : resources ( ) - > penCursor ) ;
}
}
bool UBBoardView : : hasSelectedParents ( QGraphicsItem * item )
{
if ( item - > isSelected ( ) )
return true ;
if ( item - > parentItem ( ) = = NULL )
return false ;
return hasSelectedParents ( item - > parentItem ( ) ) ;
}
@ -148,6 +148,8 @@ class UBBoardView : public QGraphicsView
bool mIsDragInProgress ;
bool mMultipleSelectionIsEnabled ;
static bool hasSelectedParents ( QGraphicsItem * item ) ;
private slots :
void settingChanged ( QVariant newValue ) ;
@ -112,6 +112,31 @@ void UBGraphicsStrokesGroup::paint(QPainter *painter, const QStyleOptionGraphics
QVariant UBGraphicsStrokesGroup : : itemChange ( GraphicsItemChange change , const QVariant & value )
{
if ( change = = QGraphicsItem : : ItemSelectedChange )
{
int a = 13 ;
}
QVariant newValue = mDelegate - > itemChange ( change , value ) ;
return QGraphicsItemGroup : : itemChange ( change , newValue ) ;
}
QPainterPath UBGraphicsStrokesGroup : : shape ( ) const
{
QPainterPath path ;
if ( isSelected ( ) )
{
path . addRect ( boundingRect ( ) ) ;
}
else
{
foreach ( QGraphicsItem * item , childItems ( ) )
{
path . addPath ( item - > shape ( ) ) ;
}
}
return path ;
}
@ -25,6 +25,9 @@ public:
virtual void setUuid ( const QUuid & pUuid ) ;
protected :
virtual QPainterPath shape ( ) const ;
virtual void mousePressEvent ( QGraphicsSceneMouseEvent * event ) ;
virtual void mouseMoveEvent ( QGraphicsSceneMouseEvent * event ) ;
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) ;