Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
c74c6cdc
Commit
c74c6cdc
authored
Oct 26, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed behavior of c++ tools.
parent
ac215755
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
13 deletions
+27
-13
UBBoardView.cpp
src/board/UBBoardView.cpp
+14
-2
UBBoardView.h
src/board/UBBoardView.h
+1
-0
UBGraphicsCompass.cpp
src/tools/UBGraphicsCompass.cpp
+12
-11
No files found.
src/board/UBBoardView.cpp
View file @
c74c6cdc
...
...
@@ -28,6 +28,7 @@
#include "core/UBApplication.h"
#include "core/UBSetting.h"
#include "core/UBPersistenceManager.h"
#include "core/UB.h"
#include "network/UBHttpGet.h"
...
...
@@ -446,6 +447,16 @@ bool UBBoardView::isUBItem(QGraphicsItem *item)
}
}
bool
UBBoardView
::
isCppTool
(
QGraphicsItem
*
item
)
{
return
(
item
->
type
()
==
UBGraphicsItemType
::
CompassItemType
||
item
->
type
()
==
UBGraphicsItemType
::
RulerItemType
||
item
->
type
()
==
UBGraphicsItemType
::
ProtractorItemType
||
item
->
type
()
==
UBGraphicsItemType
::
TriangleItemType
||
item
->
type
()
==
UBGraphicsItemType
::
AristoItemType
||
item
->
type
()
==
UBGraphicsItemType
::
CurtainItemType
);
}
void
UBBoardView
::
handleItemsSelection
(
QGraphicsItem
*
item
)
{
// we need to select new pressed itemOnBoard and deselect all other items.
...
...
@@ -1137,7 +1148,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
movingItem
=
NULL
;
}
else
if
(
movingItem
)
if
(
movingItem
&&
!
isCppTool
(
movingItem
)
)
{
if
(
suspendedMousePressEvent
)
{
...
...
@@ -1153,7 +1164,6 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
DelegateButton
::
Type
!=
movingItem
->
type
()
&&
QGraphicsSvgItem
::
Type
!=
movingItem
->
type
()
&&
UBGraphicsDelegateFrame
::
Type
!=
movingItem
->
type
()
&&
// UBToolWidget::Type != movingItem->type() &&
UBGraphicsCache
::
Type
!=
movingItem
->
type
()
&&
QGraphicsWebView
::
Type
!=
movingItem
->
type
()
&&
// for W3C widgets as Tools.
!
(
!
isMultipleSelectionEnabled
()
&&
movingItem
->
parentItem
()
&&
UBGraphicsWidgetItem
::
Type
==
movingItem
->
type
()
&&
UBGraphicsGroupContainerItem
::
Type
==
movingItem
->
parentItem
()
->
type
()))
...
...
@@ -1175,6 +1185,8 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
}
}
}
else
bReleaseIsNeed
=
true
;
if
(
mUBRubberBand
&&
mUBRubberBand
->
isVisible
())
{
mUBRubberBand
->
hide
();
...
...
src/board/UBBoardView.h
View file @
c74c6cdc
...
...
@@ -58,6 +58,7 @@ class UBBoardView : public QGraphicsView
bool
itemIsLocked
(
QGraphicsItem
*
item
);
bool
isUBItem
(
QGraphicsItem
*
item
);
// we should to determine items who is not UB and use general scene behavior for them.
bool
isCppTool
(
QGraphicsItem
*
item
);
void
handleItemsSelection
(
QGraphicsItem
*
item
);
bool
itemShouldReceiveMousePressEvent
(
QGraphicsItem
*
item
);
bool
itemShouldReceiveSuspendedMousePressEvent
(
QGraphicsItem
*
item
);
...
...
src/tools/UBGraphicsCompass.cpp
View file @
c74c6cdc
...
...
@@ -188,20 +188,21 @@ void UBGraphicsCompass::mousePressEvent(QGraphicsSceneMouseEvent *event)
UBDrawingController
::
drawingController
()
->
stylusTool
()
!=
UBStylusTool
::
Play
)
return
;
bool
closing
=
false
;
if
(
resizeButtonRect
().
contains
(
event
->
pos
()))
{
mResizing
=
true
;
m
CloseSvgItem
->
setVisible
(
false
)
;
m
Rotating
=
false
;
event
->
accept
();
}
else
if
(
hingeRect
().
contains
(
event
->
pos
()))
{
mRotating
=
true
;
mResizeSvgItem
->
setVisible
(
false
);
mCloseSvgItem
->
setVisible
(
false
);
mResizing
=
false
;
event
->
accept
();
}
else
else
if
(
!
closeButtonRect
().
contains
(
event
->
pos
()))
{
mDrawing
=
event
->
pos
().
x
()
>
rect
().
right
()
-
sPencilLength
-
sPencilBaseLength
;
if
(
mDrawing
)
...
...
@@ -211,12 +212,13 @@ void UBGraphicsCompass::mousePressEvent(QGraphicsSceneMouseEvent *event)
scene
()
->
initStroke
();
scene
()
->
moveTo
(
mSceneArcStartPoint
);
}
mResizeSvgItem
->
setVisible
(
false
);
mCloseSvgItem
->
setVisible
(
false
);
QGraphicsRectItem
::
mousePressEvent
(
event
);
}
else
closing
=
true
;
mResizeSvgItem
->
setVisible
(
mShowButtons
&&
mResizing
);
mCloseSvgItem
->
setVisible
(
mShowButtons
&&
closing
);
}
void
UBGraphicsCompass
::
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
)
...
...
@@ -272,19 +274,16 @@ void UBGraphicsCompass::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
if
(
mResizing
)
{
mResizing
=
false
;
event
->
accept
();
}
else
if
(
mRotating
)
{
mRotating
=
false
;
updateResizeCursor
();
updateDrawCursor
();
event
->
accept
();
}
else
if
(
mDrawing
)
{
mDrawing
=
false
;
updateResizeCursor
();
updateDrawCursor
();
event
->
accept
();
...
...
@@ -300,6 +299,8 @@ void UBGraphicsCompass::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
QGraphicsRectItem
::
mouseReleaseEvent
(
event
);
}
mResizing
=
false
;
mDrawing
=
false
;
if
(
scene
())
scene
()
->
setModified
(
true
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment