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
c65457e9
Commit
c65457e9
authored
Feb 16, 2016
by
Craig Watson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added "preview" dotted circle around eraser tool
parent
871e7535
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
9 deletions
+30
-9
UBBoardView.cpp
src/board/UBBoardView.cpp
+6
-1
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+21
-6
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+2
-1
UBResources.cpp
src/gui/UBResources.cpp
+1
-1
No files found.
src/board/UBBoardView.cpp
View file @
c65457e9
...
@@ -1691,9 +1691,14 @@ void UBBoardView::setToolCursor (int tool)
...
@@ -1691,9 +1691,14 @@ void UBBoardView::setToolCursor (int tool)
controlViewport
->
setCursor
(
UBResources
::
resources
()
->
penCursor
);
controlViewport
->
setCursor
(
UBResources
::
resources
()
->
penCursor
);
break
;
break
;
case
UBStylusTool
:
:
Eraser
:
case
UBStylusTool
:
:
Eraser
:
{
controlViewport
->
setCursor
(
UBResources
::
resources
()
->
eraserCursor
);
controlViewport
->
setCursor
(
UBResources
::
resources
()
->
eraserCursor
);
UBStylusTool
::
Enum
currentTool
=
(
UBStylusTool
::
Enum
)
UBDrawingController
::
drawingController
()
->
stylusTool
();
if
(
currentTool
!=
UBStylusTool
::
Eraser
)
// Avoid hiding the eraser after a click with the eraser
scene
()
->
hideEraser
();
scene
()
->
hideEraser
();
break
;
break
;
}
case
UBStylusTool
:
:
Marker
:
case
UBStylusTool
:
:
Marker
:
controlViewport
->
setCursor
(
UBResources
::
resources
()
->
markerCursor
);
controlViewport
->
setCursor
(
UBResources
::
resources
()
->
markerCursor
);
break
;
break
;
...
...
src/domain/UBGraphicsScene.cpp
View file @
c65457e9
...
@@ -424,7 +424,7 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre
...
@@ -424,7 +424,7 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre
eraserWidth
/=
UBApplication
::
boardController
->
currentZoom
();
eraserWidth
/=
UBApplication
::
boardController
->
currentZoom
();
eraseLineTo
(
scenePos
,
eraserWidth
);
eraseLineTo
(
scenePos
,
eraserWidth
);
drawEraser
(
scenePos
,
true
);
drawEraser
(
scenePos
,
mInputDeviceIsPressed
);
accepted
=
true
;
accepted
=
true
;
}
}
...
@@ -453,7 +453,7 @@ bool UBGraphicsScene::inputDeviceMove(const QPointF& scenePos, const qreal& pres
...
@@ -453,7 +453,7 @@ bool UBGraphicsScene::inputDeviceMove(const QPointF& scenePos, const qreal& pres
if
(
currentTool
==
UBStylusTool
::
Eraser
)
if
(
currentTool
==
UBStylusTool
::
Eraser
)
{
{
drawEraser
(
position
);
drawEraser
(
position
,
mInputDeviceIsPressed
);
accepted
=
true
;
accepted
=
true
;
}
}
...
@@ -541,6 +541,12 @@ bool UBGraphicsScene::inputDeviceRelease()
...
@@ -541,6 +541,12 @@ bool UBGraphicsScene::inputDeviceRelease()
accepted
=
true
;
accepted
=
true
;
}
}
UBStylusTool
::
Enum
currentTool
=
(
UBStylusTool
::
Enum
)
UBDrawingController
::
drawingController
()
->
stylusTool
();
if
(
currentTool
==
UBStylusTool
::
Eraser
)
redrawEraser
(
false
);
UBDrawingController
*
dc
=
UBDrawingController
::
drawingController
();
UBDrawingController
*
dc
=
UBDrawingController
::
drawingController
();
if
(
dc
->
isDrawingTool
()
||
mDrawWithCompass
)
if
(
dc
->
isDrawingTool
()
||
mDrawWithCompass
)
...
@@ -624,7 +630,7 @@ bool UBGraphicsScene::inputDeviceRelease()
...
@@ -624,7 +630,7 @@ bool UBGraphicsScene::inputDeviceRelease()
return
accepted
;
return
accepted
;
}
}
void
UBGraphicsScene
::
drawEraser
(
const
QPointF
&
pPoint
,
bool
isFirstDraw
)
void
UBGraphicsScene
::
drawEraser
(
const
QPointF
&
pPoint
,
bool
pressed
)
{
{
qreal
eraserWidth
=
UBSettings
::
settings
()
->
currentEraserWidth
();
qreal
eraserWidth
=
UBSettings
::
settings
()
->
currentEraserWidth
();
eraserWidth
/=
UBApplication
::
boardController
->
systemScaleFactor
();
eraserWidth
/=
UBApplication
::
boardController
->
systemScaleFactor
();
...
@@ -635,11 +641,20 @@ void UBGraphicsScene::drawEraser(const QPointF &pPoint, bool isFirstDraw)
...
@@ -635,11 +641,20 @@ void UBGraphicsScene::drawEraser(const QPointF &pPoint, bool isFirstDraw)
// TODO UB 4.x optimize - no need to do that every time we move it
// TODO UB 4.x optimize - no need to do that every time we move it
if
(
mEraser
)
{
if
(
mEraser
)
{
mEraser
->
setRect
(
QRectF
(
pPoint
.
x
()
-
eraserRadius
,
pPoint
.
y
()
-
eraserRadius
,
eraserWidth
,
eraserWidth
));
mEraser
->
setRect
(
QRectF
(
pPoint
.
x
()
-
eraserRadius
,
pPoint
.
y
()
-
eraserRadius
,
eraserWidth
,
eraserWidth
));
redrawEraser
(
pressed
);
}
}
void
UBGraphicsScene
::
redrawEraser
(
bool
pressed
)
{
if
(
mEraser
)
{
if
(
pressed
)
mEraser
->
setPen
(
QPen
(
Qt
::
SolidLine
));
else
mEraser
->
setPen
(
QPen
(
Qt
::
DotLine
));
if
(
isFirstDraw
)
{
mEraser
->
show
();
mEraser
->
show
();
}
}
}
}
}
void
UBGraphicsScene
::
drawPointer
(
const
QPointF
&
pPoint
,
bool
isFirstDraw
)
void
UBGraphicsScene
::
drawPointer
(
const
QPointF
&
pPoint
,
bool
isFirstDraw
)
...
...
src/domain/UBGraphicsScene.h
View file @
c65457e9
...
@@ -359,7 +359,8 @@ public slots:
...
@@ -359,7 +359,8 @@ public slots:
void
initPolygonItem
(
UBGraphicsPolygonItem
*
);
void
initPolygonItem
(
UBGraphicsPolygonItem
*
);
void
drawEraser
(
const
QPointF
&
pEndPoint
,
bool
isFirstDraw
=
false
);
void
drawEraser
(
const
QPointF
&
pEndPoint
,
bool
pressed
=
true
);
void
redrawEraser
(
bool
pressed
);
void
drawPointer
(
const
QPointF
&
pEndPoint
,
bool
isFirstDraw
=
false
);
void
drawPointer
(
const
QPointF
&
pEndPoint
,
bool
isFirstDraw
=
false
);
void
DisposeMagnifierQWidgets
();
void
DisposeMagnifierQWidgets
();
...
...
src/gui/UBResources.cpp
View file @
c65457e9
...
@@ -65,7 +65,7 @@ void UBResources::init()
...
@@ -65,7 +65,7 @@ void UBResources::init()
{
{
// Cursors
// Cursors
penCursor
=
QCursor
(
Qt
::
CrossCursor
);
penCursor
=
QCursor
(
Qt
::
CrossCursor
);
eraserCursor
=
QCursor
(
QPixmap
(
":/images/cursors/eraser.png"
),
21
,
21
);
eraserCursor
=
QCursor
(
QPixmap
(
":/images/cursors/eraser.png"
),
5
,
25
);
markerCursor
=
QCursor
(
QPixmap
(
":/images/cursors/marker.png"
),
3
,
30
);
markerCursor
=
QCursor
(
QPixmap
(
":/images/cursors/marker.png"
),
3
,
30
);
pointerCursor
=
QCursor
(
QPixmap
(
":/images/cursors/laser.png"
),
2
,
1
);
pointerCursor
=
QCursor
(
QPixmap
(
":/images/cursors/laser.png"
),
2
,
1
);
handCursor
=
QCursor
(
Qt
::
OpenHandCursor
);
handCursor
=
QCursor
(
Qt
::
OpenHandCursor
);
...
...
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