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
d84003e0
Commit
d84003e0
authored
Oct 07, 2011
by
shibakaneki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
cd976fef
2d2af6f5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
11 deletions
+42
-11
Sankore_3.1.pro
Sankore_3.1.pro
+1
-1
UBGraphicsDelegateFrame.cpp
src/domain/UBGraphicsDelegateFrame.cpp
+1
-1
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+38
-7
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+2
-2
No files found.
Sankore_3.1.pro
View file @
d84003e0
...
...
@@ -7,7 +7,7 @@ CONFIG += debug_and_release \
no_include_pwd
VERSION_MAJ
=
1
VERSION_MIN
=
2
6
VERSION_MIN
=
2
8
VERSION_TYPE
=
b
#
a
=
alpha
,
b
=
beta
,
r
=
release
,
other
=>
error
VERSION_PATCH
=
00
...
...
src/domain/UBGraphicsDelegateFrame.cpp
View file @
d84003e0
...
...
@@ -299,7 +299,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QSizeF
newSize
=
resizableItem
->
size
()
+
incVector
;
if
(
newSize
.
width
()
<
0
||
newSize
.
height
()
<
0
)
if
(
newSize
.
width
()
<
50
/*0*/
||
newSize
.
height
()
<
/*0*/
5
0
)
return
;
resizableItem
->
resize
(
newSize
);
...
...
src/domain/UBGraphicsScene.cpp
View file @
d84003e0
...
...
@@ -110,7 +110,7 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
mEraser
->
setRect
(
QRect
(
0
,
0
,
0
,
0
));
mEraser
->
setVisible
(
false
);
mEraser
->
setZValue
(
toolLayerStart
+
toolOffsetEraser
);
mEraser
->
setZValue
(
/*toolLayerStart + toolOffsetEraser*/
2
);
mEraser
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Control
));
mTools
<<
mEraser
;
...
...
@@ -123,7 +123,7 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
mPointer
->
setPen
(
Qt
::
NoPen
);
mPointer
->
setBrush
(
QBrush
(
QColor
(
255
,
0
,
0
,
186
)));
mPointer
->
setZValue
(
toolLayerStart
+
toolOffsetPointer
);
mPointer
->
setZValue
(
/*toolLayerStart + toolOffsetPointer*/
2
);
mPointer
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
mTools
<<
mPointer
;
...
...
@@ -230,11 +230,13 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre
eraserWidth
/=
UBApplication
::
boardController
->
currentZoom
();
eraseLineTo
(
scenePos
,
eraserWidth
);
drawEraser
(
scenePos
,
true
);
accepted
=
true
;
}
else
if
(
currentTool
==
UBStylusTool
::
Pointer
)
{
drawPointer
(
scenePos
);
drawPointer
(
scenePos
,
true
);
accepted
=
true
;
}
}
...
...
@@ -369,7 +371,7 @@ bool UBGraphicsScene::inputDeviceRelease()
// MARK: -
void
UBGraphicsScene
::
drawEraser
(
const
QPointF
&
pPoint
)
void
UBGraphicsScene
::
drawEraser
(
const
QPointF
&
pPoint
,
bool
isFirstDraw
)
{
qreal
eraserWidth
=
UBSettings
::
settings
()
->
currentEraserWidth
();
eraserWidth
/=
UBApplication
::
boardController
->
systemScaleFactor
();
...
...
@@ -381,12 +383,27 @@ void UBGraphicsScene::drawEraser(const QPointF &pPoint)
if
(
mEraser
)
{
mEraser
->
setRect
(
QRectF
(
pPoint
.
x
()
-
eraserRadius
,
pPoint
.
y
()
-
eraserRadius
,
eraserWidth
,
eraserWidth
));
mEraser
->
show
();
if
(
isFirstDraw
)
{
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
{
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
qreal
zValue
=
nextItem
->
zValue
();
nextItem
->
setZValue
(
qreal
(
1
));
qDebug
()
<<
QString
(
" %1 "
).
arg
(
i
)
<<
QString
(
" %1 "
).
arg
(
zValue
);
}
mEraser
->
setZValue
(
2
);
mEraser
->
show
();
}
}
}
void
UBGraphicsScene
::
drawPointer
(
const
QPointF
&
pPoint
)
void
UBGraphicsScene
::
drawPointer
(
const
QPointF
&
pPoint
,
bool
isFirstDraw
)
{
qreal
pointerDiameter
=
UBSettings
::
pointerDiameter
/
UBApplication
::
boardController
->
currentZoom
();
qreal
pointerRadius
=
pointerDiameter
/
2
;
...
...
@@ -399,7 +416,21 @@ void UBGraphicsScene::drawPointer(const QPointF &pPoint)
pointerDiameter
,
pointerDiameter
));
mPointer
->
show
();
if
(
isFirstDraw
)
{
QList
<
QGraphicsItem
*>
allItemsList
=
items
();
for
(
int
i
=
0
;
i
<
allItemsList
.
size
();
i
++
)
{
QGraphicsItem
*
nextItem
=
allItemsList
.
at
(
i
);
qreal
zValue
=
nextItem
->
zValue
();
nextItem
->
setZValue
(
qreal
(
1
));
qDebug
()
<<
QString
(
" %1 "
).
arg
(
i
)
<<
QString
(
" %1 "
).
arg
(
zValue
);
}
mPointer
->
setZValue
(
2
);
mPointer
->
show
();
}
}
}
...
...
src/domain/UBGraphicsScene.h
View file @
d84003e0
...
...
@@ -297,8 +297,8 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void
initPolygonItem
(
UBGraphicsPolygonItem
*
);
void
drawEraser
(
const
QPointF
&
pEndPoint
);
void
drawPointer
(
const
QPointF
&
pEndPoint
);
void
drawEraser
(
const
QPointF
&
pEndPoint
,
bool
isFirstDraw
=
false
);
void
drawPointer
(
const
QPointF
&
pEndPoint
,
bool
isFirstDraw
=
false
);
void
DisposeMagnifierQWidgets
();
...
...
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