Your ROOT_URL in app.ini is http://git.osmesh.ru/ but you are visiting https://git.osmesh.ru/MOS/OpenBoard/commit/9b8235ed5ccabf3fbfd84854db47530719784a76
You should set ROOT_URL correctly, otherwise the web may not work correctly.
3 changed files with
18 additions and
4 deletions
src/domain/UBGraphicsPolygonItem.cpp
src/domain/UBGraphicsScene.cpp
src/domain/UBGraphicsStrokesGroup.cpp
@ -185,6 +185,7 @@ void UBGraphicsPolygonItem::copyItemParameters(UBItem *copy) const
UBGraphicsPolygonItem * cp = dynamic_cast < UBGraphicsPolygonItem * > ( copy ) ;
if ( cp )
{
cp - > setPolygon ( polygon ( ) ) ;
cp - > mOriginalLine = this - > mOriginalLine ;
cp - > mOriginalWidth = this - > mOriginalWidth ;
cp - > mIsNominalLine = this - > mIsNominalLine ;
@ -198,7 +199,6 @@ void UBGraphicsPolygonItem::copyItemParameters(UBItem *copy) const
cp - > setColorOnLightBackground ( this - > colorOnLightBackground ( ) ) ;
cp - > setData ( UBGraphicsItemData : : ItemLayerType , this - > data ( UBGraphicsItemData : : ItemLayerType ) ) ;
cp - > setPolygon ( polygon ( ) ) ;
}
}
@ -1104,6 +1104,8 @@ UBGraphicsScene* UBGraphicsScene::sceneDeepCopy() const
QMap < UBGraphicsStroke * , UBGraphicsStroke * > groupClone ;
QList < QUuid > groupAlreadyCloned ;
while ( itItems . hasNext ( ) )
{
QGraphicsItem * item = itItems . next ( ) ;
@ -1111,10 +1113,18 @@ UBGraphicsScene* UBGraphicsScene::sceneDeepCopy() const
UBItem * ubItem = dynamic_cast < UBItem * > ( item ) ;
UBGraphicsStroke * stroke = dynamic_cast < UBGraphicsStroke * > ( item ) ;
UBGraphicsGroupContainerItem * group = dynamic_cast < UBGraphicsGroupContainerItem * > ( item ) ;
if ( ubItem & & ! stroke )
{
cloneItem = dynamic_cast < QGraphicsItem * > ( ubItem - > deepCopy ( ) ) ;
//horrible hack
if ( group & & ! groupAlreadyCloned . contains ( group - > uuid ( ) ) ) {
cloneItem = dynamic_cast < QGraphicsItem * > ( ubItem - > deepCopy ( ) ) ;
groupAlreadyCloned . append ( group - > uuid ( ) ) ;
}
if ( ! group )
cloneItem = dynamic_cast < QGraphicsItem * > ( ubItem - > deepCopy ( ) ) ;
}
if ( cloneItem )
@ -26,6 +26,7 @@
# include "UBGraphicsStrokesGroup.h"
# include "UBGraphicsStroke.h"
# include "domain/UBGraphicsPolygonItem.h"
@ -140,12 +141,15 @@ void UBGraphicsStrokesGroup::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
UBItem * UBGraphicsStrokesGroup : : deepCopy ( ) const
{
UBGraphicsStrokesGroup * copy = new UBGraphicsStrokesGroup ( ) ;
copyItemParameters ( copy ) ;
QTransform groupTransform = transform ( ) ;
const_cast < UBGraphicsStrokesGroup * > ( this ) - > resetTransform ( ) ;
QList < QGraphicsItem * > chl = childItems ( ) ;
UBGraphicsStroke * newStroke = new UBGraphicsStroke ;
foreach ( QGraphicsItem * child , chl )
{
UBGraphicsPolygonItem * polygon = dynamic_cast < UBGraphicsPolygonItem * > ( child ) ;
@ -155,14 +159,14 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const
if ( polygonCopy )
{
QGraphicsItem * pItem = dynamic_cast < QGraphicsItem * > ( polygonCopy ) ;
polygonCopy - > setTransform ( groupTransform ) ;
copy - > addToGroup ( pItem ) ;
polygonCopy - > setStrokesGroup ( copy ) ;
polygonCopy - > setStroke ( newStroke ) ;
}
}
}
const_cast < UBGraphicsStrokesGroup * > ( this ) - > setTransform ( groupTransform ) ;
copyItemParameters ( copy ) ;
return copy ;
}