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
ee5ad4a1
Commit
ee5ad4a1
authored
8 years ago
by
Craig Watson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better calculation of angle between stroke points
parent
dd10e240
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
UBGraphicsStroke.cpp
src/domain/UBGraphicsStroke.cpp
+1
-2
No files found.
src/domain/UBGraphicsStroke.cpp
View file @
ee5ad4a1
...
...
@@ -246,7 +246,7 @@ UBGraphicsStroke* UBGraphicsStroke::simplify()
QList
<
strokePoint
>::
iterator
b_it
(
it
+
1
);
while
(
b_it
+
1
!=
points
.
end
())
{
qreal
angle
=
qFabs
(
QLineF
(
it
->
first
,
b_it
->
first
).
angle
()
-
QLineF
(
b_it
->
first
,
(
b_it
+
1
)
->
first
).
angle
(
));
qreal
angle
=
qFabs
(
180
-
(
UBGeometryUtils
::
angle
(
it
->
first
,
b_it
->
first
,
(
b_it
+
1
)
->
first
)
));
qreal
widthRatio
=
qMax
(
it
->
second
,
b_it
->
second
)
/
qMin
(
it
->
second
,
b_it
->
second
);
if
(
widthRatio
>
thresholdWidthDifference
)
qDebug
()
<<
"Width ratio: "
<<
widthRatio
;
...
...
@@ -282,7 +282,6 @@ UBGraphicsStroke* UBGraphicsStroke::simplify()
if
(
hasAlpha
())
{
if
(
newStrokePoints
.
size
()
>
1
&&
i
<
points
.
size
()
-
1
)
{
qreal
angle
=
qFabs
(
UBGeometryUtils
::
angle
(
points
[
i
-
1
].
first
,
points
[
i
].
first
,
points
[
i
+
1
].
first
));
qDebug
()
<<
"Angle: "
<<
angle
;
if
(
angle
>
40
&&
angle
<
320
)
drawCurve
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
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